# HG changeset patch # User Jaroslav Tulach # Date 1437492848 -7200 # Node ID 547edc5af3fcc7eef35f35959d40f776153ae065 # Parent 1c38917c00b2bb7b1801e4b112c2faa379eded4c Some language REPLs need access to the current stack. Make the method public. diff -r 1c38917c00b2 -r 547edc5af3fc truffle/com.oracle.truffle.tools.debug.shell/src/com/oracle/truffle/tools/debug/shell/server/REPLServerContext.java --- a/truffle/com.oracle.truffle.tools.debug.shell/src/com/oracle/truffle/tools/debug/shell/server/REPLServerContext.java Tue Jul 21 13:07:58 2015 +0200 +++ b/truffle/com.oracle.truffle.tools.debug.shell/src/com/oracle/truffle/tools/debug/shell/server/REPLServerContext.java Tue Jul 21 17:34:08 2015 +0200 @@ -35,6 +35,7 @@ import com.oracle.truffle.api.vm.TruffleVM.Language; import com.oracle.truffle.tools.debug.shell.*; import java.util.ArrayList; +import java.util.Collections; import java.util.List; public abstract class REPLServerContext { @@ -89,7 +90,12 @@ public abstract int getBreakpointID(Breakpoint breakpoint); - List getStack() { + /** + * Provides access to the execution stack. + * + * @return immutable list of stack elements + */ + public List getStack() { List frames = new ArrayList<>(); int frameCount = 1; for (FrameInstance frameInstance : event.getStack()) { @@ -100,7 +106,7 @@ } frameCount++; } - return frames; + return Collections.unmodifiableList(frames); } void prepareStepOut() {