unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* [PATCH] Do not enter the debugger if the thrown key is in `pass-keys'
@ 2011-03-22 15:50 Mark H Weaver
  2011-03-29 11:06 ` Andy Wingo
  0 siblings, 1 reply; 2+ messages in thread
From: Mark H Weaver @ 2011-03-22 15:50 UTC (permalink / raw)
  To: guile-devel

[-- Attachment #1: Type: text/plain, Size: 51 bytes --]

FYI, I just pushed this small bug fix.

    Mark



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Do not enter the debugger if the thrown key is in `pass-keys' --]
[-- Type: text/x-diff, Size: 3505 bytes --]

From 8099352769c8b8ec8730f87f7fa6c8771b64efb9 Mon Sep 17 00:00:00 2001
From: Mark H Weaver <mhw@netris.org>
Date: Tue, 22 Mar 2011 11:11:53 -0400
Subject: [PATCH] Do not enter the debugger if the thrown key is in `pass-keys'

* module/system/repl/error-handling.scm (call-with-error-handling):
  Do _not_ enter the debugger if the thrown key is in `pass-keys'.
  Previously, for example, (throw 'quit) entered the debugger when run
  from the REPL, despite the fact that 'quit is in `pass-keys'.
---
 module/system/repl/error-handling.scm |   43 +++++++++++++++++----------------
 1 files changed, 22 insertions(+), 21 deletions(-)

diff --git a/module/system/repl/error-handling.scm b/module/system/repl/error-handling.scm
index c94db24..c6c64cc 100644
--- a/module/system/repl/error-handling.scm
+++ b/module/system/repl/error-handling.scm
@@ -122,27 +122,28 @@
       (case on-error
         ((debug)
          (lambda (key . args)
-           (let* ((tag (and (pair? (fluid-ref %stacks))
-                            (cdar (fluid-ref %stacks))))
-                  (stack (narrow-stack->vector
-                          (make-stack #t)
-                          ;; Cut three frames from the top of the stack:
-                          ;; make-stack, this one, and the throw handler.
-                          3
-                          ;; Narrow the end of the stack to the most recent
-                          ;; start-stack.
-                          tag
-                          ;; And one more frame, because %start-stack invoking
-                          ;; the start-stack thunk has its own frame too.
-                          0 (and tag 1)))
-                  (error-msg (error-string stack key args))
-                  (debug (make-debug stack 0 error-msg #f)))
-             (with-saved-ports
-              (lambda ()
-                (format #t "~a~%" error-msg)
-                (format #t "Entering a new prompt.  ")
-                (format #t "Type `,bt' for a backtrace or `,q' to continue.\n")
-                ((@ (system repl repl) start-repl) #:debug debug))))))
+           (if (not (memq key pass-keys))
+               (let* ((tag (and (pair? (fluid-ref %stacks))
+                                (cdar (fluid-ref %stacks))))
+                      (stack (narrow-stack->vector
+                              (make-stack #t)
+                              ;; Cut three frames from the top of the stack:
+                              ;; make-stack, this one, and the throw handler.
+                              3
+                              ;; Narrow the end of the stack to the most recent
+                              ;; start-stack.
+                              tag
+                              ;; And one more frame, because %start-stack invoking
+                              ;; the start-stack thunk has its own frame too.
+                              0 (and tag 1)))
+                      (error-msg (error-string stack key args))
+                      (debug (make-debug stack 0 error-msg #f)))
+                 (with-saved-ports
+                  (lambda ()
+                    (format #t "~a~%" error-msg)
+                    (format #t "Entering a new prompt.  ")
+                    (format #t "Type `,bt' for a backtrace or `,q' to continue.\n")
+                    ((@ (system repl repl) start-repl) #:debug debug)))))))
         ((report)
          (lambda (key . args)
            (if (not (memq key pass-keys))
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Do not enter the debugger if the thrown key is in `pass-keys'
  2011-03-22 15:50 [PATCH] Do not enter the debugger if the thrown key is in `pass-keys' Mark H Weaver
@ 2011-03-29 11:06 ` Andy Wingo
  0 siblings, 0 replies; 2+ messages in thread
From: Andy Wingo @ 2011-03-29 11:06 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: guile-devel

On Tue 22 Mar 2011 16:50, Mark H Weaver <mhw@netris.org> writes:

> FYI, I just pushed this small bug fix.

Thanks!

Andy
-- 
http://wingolog.org/



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-03-29 11:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-22 15:50 [PATCH] Do not enter the debugger if the thrown key is in `pass-keys' Mark H Weaver
2011-03-29 11:06 ` Andy Wingo

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).