@Override boolean isRootIncluded(Set<Class<?>> providedTags, SourceSection rootSection, RootNode rootNode, int rootNodeBits) { return rootNode == null || !rootNode.isInternal(); }
@Override boolean isRootIncluded(Set<Class<?>> providedTags, SourceSection rootSection, RootNode rootNode, int rootNodeBits) { return rootNode == null || !rootNode.isInternal(); }
/** * Returns whether this trace element is a language implementation artifact. * <p> * The decision to mark a method as <em>internal</em> is language-specific, reflects judgments * about tool usability, and is subject to change. * * @since 1.0 */ public boolean isInternal() { RootNode root = findCurrentRoot(); if (root == null) { return true; } return root.isInternal(); }
return true; return root.isInternal();
return true; return root.isInternal();
private static void appendLazyStackTrace(Node callNode, RootCallTarget root, Frame currentFrame, LazyStackTrace lazy, int stackTraceElementLimit) { if (lazy.stackTrace == null) { if (stackTraceElementLimit >= 0 && lazy.frameCount >= stackTraceElementLimit) { return; } boolean captureFrames = root != null && root.getRootNode().isCaptureFramesForTrace(); lazy.current = new TracebackElement(lazy.current, callNode, root, captureFrames ? currentFrame.materialize() : null); if (root != null && !root.getRootNode().isInternal()) { lazy.frameCount++; } } }
private static void appendLazyStackTrace(Node callNode, RootCallTarget root, Frame currentFrame, LazyStackTrace lazy, int stackTraceElementLimit) { if (lazy.stackTrace == null) { if (stackTraceElementLimit >= 0 && lazy.frameCount >= stackTraceElementLimit) { return; } boolean captureFrames = root != null && root.getRootNode().isCaptureFramesForTrace(); lazy.current = new TracebackElement(lazy.current, callNode, root, captureFrames ? currentFrame.materialize() : null); if (root != null && !root.getRootNode().isInternal()) { lazy.frameCount++; } } }
@Override public Caller visitFrame(FrameInstance frameInstance) { // we stop at eval root stack frames if (!SuspendedEvent.isEvalRootStackFrame(DebuggerSession.this, frameInstance) && (depth++ == 0)) { return null; } Node callNode = frameInstance.getCallNode(); while (callNode != null && !SourceSectionFilter.ANY.includes(callNode)) { callNode = callNode.getParent(); } if (callNode == null) { return null; } RootNode root = callNode.getRootNode(); if (root == null || !includeInternal && root.isInternal()) { return null; } return new Caller(frameInstance, callNode); } });
@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; } });
static PolyglotExceptionFrame createGuest(PolyglotExceptionImpl exception, TruffleStackTraceElement frame, boolean first) { if (frame == null) { return null; } RootNode targetRoot = frame.getTarget().getRootNode(); if (targetRoot.isInternal()) { return null; } LanguageInfo info = targetRoot.getLanguageInfo(); if (info == null) { return null; } PolyglotEngineImpl engine = exception.context.getEngine(); PolyglotLanguage language = engine.idToLanguage.get(info.getId()); String rootName = targetRoot.getName(); SourceSection location; Node callNode = frame.getLocation(); if (callNode != null) { com.oracle.truffle.api.source.SourceSection section = callNode.getEncapsulatingSourceSection(); if (section != null) { Source source = engine.getAPIAccess().newSource(language.getId(), section.getSource()); location = engine.getAPIAccess().newSourceSection(source, section); } else { location = null; } } else { location = first ? exception.getSourceLocation() : null; } return new PolyglotExceptionFrame(exception, language, location, rootName, false, null); }
static PolyglotExceptionFrame createGuest(PolyglotExceptionImpl exception, TruffleStackTraceElement frame, boolean first) { if (frame == null) { return null; } RootNode targetRoot = frame.getTarget().getRootNode(); if (targetRoot.isInternal()) { return null; } LanguageInfo info = targetRoot.getLanguageInfo(); if (info == null) { return null; } PolyglotEngineImpl engine = exception.getEngine(); PolyglotLanguage language = engine.idToLanguage.get(info.getId()); String rootName = targetRoot.getName(); SourceSection location; Node callNode = frame.getLocation(); if (callNode != null) { com.oracle.truffle.api.source.SourceSection section = callNode.getEncapsulatingSourceSection(); if (section != null) { Source source = engine.getAPIAccess().newSource(language.getId(), section.getSource()); location = engine.getAPIAccess().newSourceSection(source, section); } else { location = null; } } else { location = first ? exception.getSourceLocation() : null; } return new PolyglotExceptionFrame(exception, language, location, rootName, false, null); }