From: Christophe Rhodes Date: Thu, 19 Aug 2010 07:59:42 +0000 (+0100) Subject: return properly from sldbLoop() X-Git-Url: http://christophe.rhodes.io/gitweb/?p=swankr.git;a=commitdiff_plain;h=19a4e9d454ec87e4374c5e92d69b47c7548fb5af;hp=081a80aba6b863a9ae5aafd16e12a114e4a5c339 return properly from sldbLoop() Always emit a :debug-return message. The extra :sldb-return stuff in swank.lisp is (I think) only needed for multiple threads. --- diff --git a/swank.R b/swank.R index ca1eff9..f3a85cc 100644 --- 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) {