fix error handling when reading debugger args
authorAndy Wingo <wingo@pobox.com>
Thu, 10 Jun 2010 11:44:37 +0000 (13:44 +0200)
committerAndy Wingo <wingo@pobox.com>
Thu, 10 Jun 2010 12:15:26 +0000 (14:15 +0200)
* module/system/vm/debug.scm (debugger-repl): Errors reading debugger
  args no longer drop us out of the debugger.

module/system/vm/debug.scm

index be6d031..8151356 100644 (file)
@@ -397,11 +397,16 @@ With an argument, select a frame by index, then show it."
       (catch 'quit
         (lambda ()
           (let loop ()
-            (let ((args (save-module-excursion
+            (let ((args (call-with-error-handling
                          (lambda ()
-                           (set-current-module commands)
-                           (read-args prompt)))))
-              (apply handle args)
+                           (save-module-excursion
+                            (lambda ()
+                              (set-current-module commands)
+                              (read-args prompt))))
+                         #:on-error 'pass)))
+              ;; args will be unspecified if there was a read error.
+              (if (not (unspecified? args))
+                  (apply handle args))
               (loop))))
         (lambda (k . args)
           (apply values args))))))