static CatchLocation getCatchNode(Debugger debugger, Node throwNode, Throwable exception) { CatchLocation[] catchLocationPtr = new CatchLocation[]{null}; Truffle.getRuntime().iterateFrames(new FrameInstanceVisitor<FrameInstance>() { private int depth = 0; @Override public FrameInstance visitFrame(FrameInstance frameInstance) { Node node; if (depth == 0) { node = throwNode; } else { node = frameInstance.getCallNode(); } if (node != null) { Node catchNode = getCatchNode(debugger.getMessageNodes(), node, exception); if (catchNode != null) { catchLocationPtr[0] = new CatchLocation(catchNode.getSourceSection(), frameInstance, depth); return frameInstance; } } depth++; return null; } }); return catchLocationPtr[0]; }
public static Throwable fillInMumblerStackTrace(Throwable t) { final List<StackTraceElement> stackTrace = new ArrayList<>(); Truffle.getRuntime().iterateFrames(new FrameInstanceVisitor<Void>() { @Override public Void visitFrame(FrameInstance frame) {
ArrayList<StackTraceEntry> getInitialStack(Node instrumentedNode) { ArrayList<StackTraceEntry> sourceLocations = new ArrayList<>(); reconstructStack(sourceLocations, instrumentedNode, sourceSectionFilter, initInstrumenter); Truffle.getRuntime().iterateFrames(frame -> { Node node = frame.getCallNode(); if (node != null) { reconstructStack(sourceLocations, node, sourceSectionFilter, initInstrumenter); } return null; }); Collections.reverse(sourceLocations); return sourceLocations; }
private List<DebugStackFrame> getOtherFrames() { if (otherFrames == null) { final List<DebugStackFrame> frameInstances = new ArrayList<>(); Truffle.getRuntime().iterateFrames(new FrameInstanceVisitor<FrameInstance>() { private int depth = -context.getStackDepth() - 1; @Override public FrameInstance visitFrame(FrameInstance frameInstance) { if (isEvalRootStackFrame(session, frameInstance)) { // we stop at eval root stack frames return frameInstance; } if (++depth <= 0) { return null; } frameInstances.add(new DebugStackFrame(SuspendedEvent.this, frameInstance, depth)); return null; } }); otherFrames = frameInstances; } return otherFrames; }
private List<DebugStackFrame> getOtherFrames() { if (otherFrames == null) { final List<DebugStackFrame> frameInstances = new ArrayList<>(); Truffle.getRuntime().iterateFrames(new FrameInstanceVisitor<FrameInstance>() { private int depth = -context.getStackDepth() - 1; @Override public FrameInstance visitFrame(FrameInstance frameInstance) { if (isEvalRootStackFrame(session, frameInstance)) { // we stop at eval root stack frames return frameInstance; } if (++depth <= 0) { return null; } frameInstances.add(new DebugStackFrame(SuspendedEvent.this, frameInstance, depth)); return null; } }); otherFrames = frameInstances; } return otherFrames; }
Truffle.getRuntime().iterateFrames(new FrameInstanceVisitor<FrameInstance>() { boolean first = true; int stackFrameIndex = lazyFrames;
Truffle.getRuntime().iterateFrames(new FrameInstanceVisitor<FrameInstance>() { boolean first = true; int stackFrameIndex = lazyFrames;
Caller caller = Truffle.getRuntime().iterateFrames(new FrameInstanceVisitor<Caller>() { private int depth = 0;
Caller caller = Truffle.getRuntime().iterateFrames(new FrameInstanceVisitor<Caller>() { private int depth = 0;
Caller caller = Truffle.getRuntime().iterateFrames(new FrameInstanceVisitor<Caller>() { private int depth = 0;