From f0e964468a16d45bd23117bcb720f2d733018791 Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Sat, 14 Aug 2010 21:12:20 +0100 Subject: [PATCH] store calls and frames on entry to sldb itself Rather than do complicated stuff to keep track of where we are in the stack, simply store the interesting frames and calls in the sldb state structure. --- swank.R | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/swank.R b/swank.R index 09ad173..b5fd98c 100644 --- a/swank.R +++ b/swank.R @@ -54,7 +54,9 @@ emacsRex <- function(io, sldbState, form, pkg, thread, id, level=0) { } makeSldbState <- function(condition, level, id) { - ret <- list(condition=condition, level=level, id=id) + calls <- rev(sys.calls())[-1] + frames <- rev(sys.frames())[-1] + ret <- list(condition=condition, level=level, id=id, calls=calls, frames=frames) class(ret) <- c("sldbState", class(ret)) ret } @@ -69,7 +71,7 @@ sldbLoop <- function(io, sldbState, id) { debuggerInfoForEmacs <- function(sldbState, from=0, to=NULL) { backtraceForEmacs <- function() { - calls <- rev(sys.calls()) + calls <- sldbState$calls if(is.null(to)) to <- length(calls) from <- from+1 calls <- lapply(calls[from:to], { frameNumber <- from-1; -- 2.39.5