From 19a4e9d454ec87e4374c5e92d69b47c7548fb5af Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Thu, 19 Aug 2010 08:59:42 +0100 Subject: [PATCH] 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. --- swank.R | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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) { -- 2.39.5