[gambit-list] Slight improvment for the debugger interface?

Derek Peschel dpeschel at eskimo.com
Sat Jul 18 14:25:52 EDT 2009


On Sat, Jul 18, 2009 at 02:11:16PM -0400, David St-Hilaire wrote:
> $ gsi -v
> v4.4.4 20090611032636 i686-pc-linux-gnu "./configure --prefix=/opt/gambit-c
> --enable-single-host"
> 
> Thank you :)

You're welcome!  I found my changes and regenerated the patch and included
it below.  It applies to v4.2.2 and I haven't tried changing any 4.3/4.4
versions or even downloaded them.  I wanted to get _something_ posted
right away, though, instead of making you wait.

The new command is ,r which is short for "reason".  ,e is already short
for "environment" so it can't be short for "error message" at the same time.
The patch also fixes some indentation.

--- _repl.scm.orig	Sun Feb 10 22:59:56 2008
+++ _repl.scm	Sun Mar  2 02:50:04 2008
@@ -880,6 +880,7 @@
 ,qt           : Terminate the current thread
 ,t            : Jump to toplevel REPL
 ,d            : Jump to enclosing REPL
+,r            : Display reason for entering this REPL
 ,c and ,(c X) : Continue the computation with stepping off
 ,s and ,(s X) : Continue the computation with stepping on (step)
 ,l and ,(l X) : Continue the computation with stepping on (leap)
@@ -2351,10 +2352,10 @@
                       (continue))
                      ((##eq? cmd 'e)
                       (##repl-channel-display-multiline-message
-                       (lambda (output-port)
-                         (##cmd-e (first-interesting
-                                   (macro-repl-context-cont repl-context))
-                                  output-port)))
+                      (lambda (output-port)
+                        (##cmd-e (first-interesting
+                                  (macro-repl-context-cont repl-context))
+                                 output-port)))
                       (continue))
                      ((##eq? cmd 't)
                       (cmd-t))
@@ -2365,6 +2366,14 @@
                       (quit))
                      ((##eq? cmd 'qt)
                       (quit-thread))
+                     ((##eq? cmd 'r)
+                      (if write-reason
+                        (##repl-channel-display-multiline-message
+                        (lambda (output-port)
+                          (write-reason (first-interesting
+                                         (macro-repl-context-cont repl-context))
+                                        output-port))))
+                      (continue))
                      ((and (##fixnum? cmd)
                            (##not (##fixnum.< cmd 0)))
                       (goto-depth cmd))



More information about the Gambit-list mailing list