Mercurial > hg > truffle
diff truffle/com.oracle.truffle.tools.debug.shell/src/com/oracle/truffle/tools/debug/shell/server/REPLServerContext.java @ 22268:b56fe0d3b560
Merge with acfea340b19199faaa44bd5e103c716c17ea2b21
author | Michael Van De Vanter <michael.van.de.vanter@oracle.com> |
---|---|
date | Wed, 30 Sep 2015 19:40:55 -0700 |
parents | 0d36601f233e dc91e9ee752e |
children | 414e82b9fc35 |
line wrap: on
line diff
--- a/truffle/com.oracle.truffle.tools.debug.shell/src/com/oracle/truffle/tools/debug/shell/server/REPLServerContext.java Wed Sep 30 16:34:53 2015 -0700 +++ b/truffle/com.oracle.truffle.tools.debug.shell/src/com/oracle/truffle/tools/debug/shell/server/REPLServerContext.java Wed Sep 30 19:40:55 2015 -0700 @@ -24,10 +24,6 @@ */ package com.oracle.truffle.tools.debug.shell.server; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - import com.oracle.truffle.api.debug.Breakpoint; import com.oracle.truffle.api.debug.Debugger; import com.oracle.truffle.api.debug.SuspendedEvent; @@ -39,6 +35,10 @@ import com.oracle.truffle.api.vm.PolyglotEngine; import com.oracle.truffle.api.vm.PolyglotEngine.Language; import com.oracle.truffle.tools.debug.shell.REPLMessage; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; public abstract class REPLServerContext { @@ -65,6 +65,19 @@ } /** + * Evaluates given code snippet in the context of currently suspended execution. + * + * @param code the snippet to evaluate + * @param frame <code>null</code> in case the evaluation should happen in top most frame, + * non-null value + * @return result of the evaluation + * @throws IOException if something goes wrong + */ + public Object eval(String code, FrameInstance frame) throws IOException { + return event.eval(code, frame); + } + + /** * The frame where execution is halted in this context. */ public MaterializedFrame getFrameAtHalt() {