From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Mikael Djurfeldt Newsgroups: gmane.lisp.guile.devel,gmane.lisp.guile.user Subject: Re: Ditching (debug-enable 'backwards) ? Date: 06 Nov 2002 13:49:40 +0100 Sender: guile-devel-admin@gnu.org Message-ID: References: <8765veblg1.fsf@zagadka.ping.de> Reply-To: djurfeldt@nada.kth.se NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1036588006 31438 80.91.224.249 (6 Nov 2002 13:06:46 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 6 Nov 2002 13:06:46 +0000 (UTC) Cc: Marius Vollmer , Guile Development , Guile Users Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 189PtM-0008Au-00 for ; Wed, 06 Nov 2002 14:06:44 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 189Pqm-0001EV-00; Wed, 06 Nov 2002 08:04:04 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 189Pd6-0000qU-00 for guile-devel@gnu.org; Wed, 06 Nov 2002 07:49:56 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 189Pd2-0000pT-00 for guile-devel@gnu.org; Wed, 06 Nov 2002 07:49:55 -0500 Original-Received: from kvast.blakulla.net ([213.212.20.77]) by monty-python.gnu.org with esmtp (Exim 4.10) id 189Pd1-0000pJ-00; Wed, 06 Nov 2002 07:49:52 -0500 Original-Received: from dyna224-221.nada.kth.se ([130.237.224.221] helo=linnaeus) by kvast.blakulla.net with esmtp (Exim 3.36 #1 (Debian)) id 189Pcr-000378-00; Wed, 06 Nov 2002 13:49:41 +0100 Original-Received: from mdj by linnaeus with local (Exim 3.36 #1 (Debian)) id 189Pcr-0003OA-00; Wed, 06 Nov 2002 13:49:41 +0100 Original-To: Neil Jerram Original-Cc: djurfeldt@nada.kth.se In-Reply-To: Original-Lines: 61 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Errors-To: guile-devel-admin@gnu.org X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Developers list for Guile, the GNU extensibility library List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.lisp.guile.devel:1650 gmane.lisp.guile.user:1340 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:1340 Neil Jerram 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