Christophe Weblog Wiki Code Publications Music
return properly from sldbLoop()
authorChristophe Rhodes <csr21@cantab.net>
Thu, 19 Aug 2010 07:59:42 +0000 (08:59 +0100)
committerChristophe Rhodes <csr21@cantab.net>
Thu, 19 Aug 2010 07:59:42 +0000 (08:59 +0100)
Always emit a :debug-return message.  The extra :sldb-return stuff in
swank.lisp is (I think) only needed for multiple threads.

swank.R

diff --git a/swank.R b/swank.R
index ca1eff93665ed4b1625e4509a06178355d44a275..f3a85ccc6a8b0d770b9273180bb179e717fc736d 100644 (file)
--- a/swank.R
+++ b/swank.R
@@ -64,11 +64,13 @@ makeSldbState <- function(condition, level, id) {
 }
 
 sldbLoop <- function(io, sldbState, id) {
-  sendToEmacs(io, c(list(quote(`:debug`), id, sldbState$level), debuggerInfoForEmacs(sldbState)))
-  sendToEmacs(io, list(quote(`:debug-activate`), id, sldbState$level, FALSE))
-  while(TRUE) {
-    dispatch(io, readPacket(io), sldbState)
-  }
+  tryCatch({
+    sendToEmacs(io, c(list(quote(`:debug`), id, sldbState$level), debuggerInfoForEmacs(sldbState)))
+    sendToEmacs(io, list(quote(`:debug-activate`), id, sldbState$level, FALSE))
+    while(TRUE) {
+      dispatch(io, readPacket(io), sldbState)
+    }
+  }, finally=sendToEmacs(io, c(list(quote(`:debug-return`), id, sldbState$level, FALSE))))
 }
 
 debuggerInfoForEmacs <- function(sldbState, from=0, to=NULL) {