Christophe Weblog Wiki Code Publications Music
return stack frames in slime's order (most recent first)
[swankr.git] / swank.R
diff --git a/swank.R b/swank.R
index 71d502ecc03039de80f2de99401c8003d98cb963..c6a1ec2f0e0afe13d7e90a3910370bbb3dfe49ef 100644 (file)
--- a/swank.R
+++ b/swank.R
@@ -69,7 +69,7 @@ sldbLoop <- function(io, sldbState, id) {
 
 debuggerInfoForEmacs <- function(sldbState, from=0, to=NULL) {
   backtraceForEmacs <- function() {
-    calls <- sys.calls()
+    calls <- rev(sys.calls())
     if(is.null(to)) to <- length(calls)
     from <- from+1
     calls <- lapply(calls[from:to], { frameNumber <- from-1;
@@ -239,7 +239,7 @@ writeSexpToString <- function(obj) {
 }
 
 `swank:listener-eval` <- function(io, sldbState, string) {
-  val <- eval(parse(text=string))
+  val <- eval(parse(text=string), envir = globalenv())
   f <- fifo("")
   sink(f)
   print(val)