* Ditching (debug-enable 'backwards) ?
@ 2002-10-27 13:04 Neil Jerram
2002-11-03 17:41 ` Marius Vollmer
0 siblings, 1 reply; 7+ messages in thread
From: Neil Jerram @ 2002-10-27 13:04 UTC (permalink / raw)
Does anyone use (debug-enable 'backwards) and have a good reason for
keeping it?
In my view, it makes documenting the debugger harder, is likely to
introduce bugs in the debugger code (if there aren't any there
already), and is simply pointless, so I propose to get rid of it.
(With deprecation, of course ...)
(Cf. the recent discussion on options on gnucash-devel. I'd say this
is a classic example of a pointless option whose only rationale is
that someone wanted to avoid making a decision.)
Neil
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Ditching (debug-enable 'backwards) ?
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
0 siblings, 1 reply; 7+ messages in thread
From: Marius Vollmer @ 2002-11-03 17:41 UTC (permalink / raw)
Cc: Guile Development, Guile Users
Neil Jerram <neil@ossau.uklinux.net> writes:
> Does anyone use (debug-enable 'backwards) and have a good reason for
> keeping it?
Hmm. I'd say we should only remove it when there is significant cost
associated with it. Since we already have it, we might as well keep
it. Maybe it will make someone happy. :-)
> In my view, it makes documenting the debugger harder,
It would good enough to just document the default case and only
mention somewhere that the backtrace can also be displayed backwards
but that the documentation assumes that it is not being done.
> is likely to introduce bugs in the debugger code (if there aren't
> any there already),
Is that so? The 'backwards' option should only matter during display
and we already have that code, right?
On the other hand, if you need to write new display code for the
debugger and the backwards option makes that significantly harder, I'd
say it is OK to remove it.
--
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3 331E FAF8 226A D5D4 E405
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Ditching (debug-enable 'backwards) ?
2002-11-03 17:41 ` Marius Vollmer
@ 2002-11-04 20:01 ` Neil Jerram
2002-11-04 21:42 ` Marius Vollmer
2002-11-06 12:49 ` Mikael Djurfeldt
0 siblings, 2 replies; 7+ messages in thread
From: Neil Jerram @ 2002-11-04 20:01 UTC (permalink / raw)
Cc: Guile Development, Guile Users
>>>>> "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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Ditching (debug-enable 'backwards) ?
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
1 sibling, 2 replies; 7+ messages in thread
From: Marius Vollmer @ 2002-11-04 21:42 UTC (permalink / raw)
Cc: Guile Development, Guile Users
Neil Jerram <neil@ossau.uklinux.net> writes:
> To be more precise, what I don't like about 'backwards is that it
> changes how the displayed frames are _numbered_:
Well, that sounds like the wrong thing to do wrong. I thought that
'backwards would just print the same lines as the forward display,
only in reverse order. There shouldn't really be any more difference
between the two, no?
> I have no objection to frames appearing in reverse order, but I prefer
> that they were then _numbered_ like this (artist's impression):
Yes, exactly my opinion as well.
> Marius> Is that so? The 'backwards' option should only matter
> Marius> during display 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.
Yes. We should either fix the backwards display then, or disable it
(but leave the code in so that it can be fixed later).
> 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.)
GDB's convention sounds more useful to me. The innermost frame is
more important than the outermost one and should get a simple index.
With our convention, you have to know how many frames there are before
being able to name the innermost one or any frame relative to it.
Is it possible to fix this without creating a lot of confusion?
--
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3 331E FAF8 226A D5D4 E405
_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Ditching (debug-enable 'backwards) ?
2002-11-04 21:42 ` Marius Vollmer
@ 2002-11-05 23:13 ` Neil Jerram
2002-11-06 12:50 ` Mikael Djurfeldt
1 sibling, 0 replies; 7+ messages in thread
From: Neil Jerram @ 2002-11-05 23:13 UTC (permalink / raw)
Cc: Guile Development, Guile Users
>>>>> "Marius" == Marius Vollmer <mvo@zagadka.ping.de> writes:
>> I have no objection to frames appearing in reverse order, but I prefer
>> that they were then _numbered_ like this (artist's impression):
Marius> Yes, exactly my opinion as well.
OK - thanks.
Marius> GDB's convention sounds more useful to me. The innermost frame is
Marius> more important than the outermost one and should get a simple index.
Marius> With our convention, you have to know how many frames there are before
Marius> being able to name the innermost one or any frame relative to it.
Marius> Is it possible to fix this without creating a lot of confusion?
I'll take a look. I don't think it's acceptable to reverse the
meaning of `stack-ref', but it should be OK to change details of the
debugger display; if the Emacs interface relies on these details, we
can change it correspondingly.
Neil
_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Ditching (debug-enable 'backwards) ?
2002-11-04 20:01 ` Neil Jerram
2002-11-04 21:42 ` Marius Vollmer
@ 2002-11-06 12:49 ` Mikael Djurfeldt
1 sibling, 0 replies; 7+ messages in thread
From: Mikael Djurfeldt @ 2002-11-06 12:49 UTC (permalink / raw)
Cc: Marius Vollmer, Guile Development, Guile Users
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Ditching (debug-enable 'backwards) ?
2002-11-04 21:42 ` Marius Vollmer
2002-11-05 23:13 ` Neil Jerram
@ 2002-11-06 12:50 ` Mikael Djurfeldt
1 sibling, 0 replies; 7+ messages in thread
From: Mikael Djurfeldt @ 2002-11-06 12:50 UTC (permalink / raw)
Cc: Neil Jerram, Guile Development, Guile Users
Marius Vollmer <mvo@zagadka.ping.de> writes:
> GDB's convention sounds more useful to me. The innermost frame is
> more important than the outermost one and should get a simple index.
> With our convention, you have to know how many frames there are before
> being able to name the innermost one or any frame relative to it.
But see my reply to Neil.
Best,
M
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2002-11-06 12:50 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).