Search in sources :

Example 1 with Result

use of com.oracle.truffle.tools.chromeinspector.commands.Result in project graal by oracle.

the class TruffleDebugger method restartFrame.

@Override
public Params restartFrame(long cmdId, String callFrameId, CommandPostProcessor postProcessor) throws CommandProcessException {
    if (callFrameId == null) {
        throw new CommandProcessException("A callFrameId required.");
    }
    int frameId;
    try {
        frameId = Integer.parseInt(callFrameId);
    } catch (NumberFormatException ex) {
        throw new CommandProcessException(ex.getLocalizedMessage());
    }
    DebuggerSuspendedInfo susp = suspendedInfo;
    if (susp != null) {
        if (frameId >= susp.getCallFrames().length) {
            throw new CommandProcessException("Too big callFrameId: " + frameId);
        }
        CallFrame cf = susp.getCallFrames()[frameId];
        susp.getSuspendedEvent().prepareUnwindFrame(cf.getFrame());
        postProcessor.setPostProcessJob(() -> {
            silentResume = true;
            commandLazyResponse = (DebuggerSuspendedInfo suspInfo) -> {
                JSONObject res = new JSONObject();
                res.put("callFrames", getFramesParam(suspInfo.getCallFrames()));
                return new Event(cmdId, new Result(new Params(res)));
            };
            doResume();
        });
    }
    return new Params(null);
}
Also used : CommandProcessException(com.oracle.truffle.tools.chromeinspector.server.CommandProcessException) JSONObject(org.json.JSONObject) CallFrame(com.oracle.truffle.tools.chromeinspector.types.CallFrame) SuspendedEvent(com.oracle.truffle.api.debug.SuspendedEvent) Event(com.oracle.truffle.tools.chromeinspector.events.Event) Params(com.oracle.truffle.tools.chromeinspector.commands.Params) Breakpoint(com.oracle.truffle.api.debug.Breakpoint) Result(com.oracle.truffle.tools.chromeinspector.commands.Result)

Aggregations

Breakpoint (com.oracle.truffle.api.debug.Breakpoint)1 SuspendedEvent (com.oracle.truffle.api.debug.SuspendedEvent)1 Params (com.oracle.truffle.tools.chromeinspector.commands.Params)1 Result (com.oracle.truffle.tools.chromeinspector.commands.Result)1 Event (com.oracle.truffle.tools.chromeinspector.events.Event)1 CommandProcessException (com.oracle.truffle.tools.chromeinspector.server.CommandProcessException)1 CallFrame (com.oracle.truffle.tools.chromeinspector.types.CallFrame)1 JSONObject (org.json.JSONObject)1