/** * Accesses the underlying frame using a specified {@link FrameAccess access mode}. * * @see FrameAccess * @since 0.23 */ default Frame getFrame(FrameAccess access) { return getFrame(access, true); }
/** * Accesses the underlying frame using a specified {@link FrameAccess access mode}. * * @see FrameAccess * @since 0.23 */ default Frame getFrame(FrameAccess access) { return getFrame(access, true); }
/** * @since 1.0 */ @Override public boolean equals(Object obj) { if (obj instanceof DebugStackFrame) { DebugStackFrame other = (DebugStackFrame) obj; return event == other.event && (currentFrame == other.currentFrame || currentFrame != null && other.currentFrame != null && currentFrame.getFrame(FrameAccess.READ_ONLY) == other.currentFrame.getFrame(FrameAccess.READ_ONLY)); } return false; }
/** * * @since 0.8 or earlier * @deprecated use {@link #getFrame(FrameAccess)} instead. It is equivalent to * <code>FrameInstance.getFrame(access, true)</code>. */ @Deprecated default Frame getFrame(FrameAccess access, @SuppressWarnings("unused") boolean slowPath) { return getFrame(access); }
/** * * @since 0.8 or earlier * @deprecated use {@link #getFrame(FrameAccess)} instead. It is equivalent to * <code>FrameInstance.getFrame(access, true)</code>. */ @Deprecated default Frame getFrame(FrameAccess access, @SuppressWarnings("unused") boolean slowPath) { return getFrame(access); }
MaterializedFrame findTruffleFrame() { if (currentFrame == null) { return event.getMaterializedFrame(); } else { return currentFrame.getFrame(FrameAccess.MATERIALIZE).materialize(); } }
MaterializedFrame findTruffleFrame() { if (currentFrame == null) { return event.getMaterializedFrame(); } else { return currentFrame.getFrame(FrameAccess.MATERIALIZE).materialize(); } }
/** * Evaluates a snippet of code in a halted execution context. Assumes frame is part of the * current execution stack, behavior is undefined if not. * * @param ev event notification where execution is halted * @param code text of the code to be executed * @param frameInstance frame where execution is halted * @return * @throws IOException */ static Object evalInContext(SuspendedEvent ev, String code, FrameInstance frameInstance) throws IOException { try { Node node; MaterializedFrame frame; if (frameInstance == null) { node = ev.getContext().getInstrumentedNode(); frame = ev.getMaterializedFrame(); } else { node = frameInstance.getCallNode(); frame = frameInstance.getFrame(FrameAccess.MATERIALIZE).materialize(); } return Debugger.ACCESSOR.evalInContext(node, frame, code); } catch (KillException kex) { throw new IOException("Evaluation was killed.", kex); } }
@Override public FrameInstance visitFrame(FrameInstance frameInstance) { if (stackFrameLimit >= 0 && stackFrameIndex >= stackFrameLimit) { // no more frames to create return frameInstance; } Node location = frameInstance.getCallNode(); RootCallTarget target = (RootCallTarget) frameInstance.getCallTarget(); if (first) { location = topCallSite; first = false; } boolean captureFrames = target != null && target.getRootNode().isCaptureFramesForTrace(); Frame frame = captureFrames ? frameInstance.getFrame(FrameAccess.READ_ONLY) : null; frames.add(new TruffleStackTraceElement(location, target, frame)); first = false; if (target != null && !target.getRootNode().isInternal()) { stackFrameIndex++; } return null; } });
@Override public FrameInstance visitFrame(FrameInstance frameInstance) { if (stackFrameLimit >= 0 && stackFrameIndex >= stackFrameLimit) { // no more frames to create return frameInstance; } Node location = frameInstance.getCallNode(); RootCallTarget target = (RootCallTarget) frameInstance.getCallTarget(); if (first) { location = topCallSite; first = false; } boolean captureFrames = target != null && target.getRootNode().isCaptureFramesForTrace(); Frame frame = captureFrames ? frameInstance.getFrame(FrameAccess.READ_ONLY) : null; frames.add(new TruffleStackTraceElement(location, target, frame)); first = false; if (target != null && !target.getRootNode().isInternal()) { stackFrameIndex++; } return null; } });
} else { node = frameInstance.getCallNode(); frame = frameInstance.getFrame(FrameAccess.MATERIALIZE).materialize();