/** * @return a source section, or <code>null</code> if the catch source section is not known. * @since 1.0 */ public SourceSection getSourceSection() { return session.resolveSection(section); }
/** * Returns the guest language source section of the AST node before/after the execution is * suspended. Returns <code>null</code> if no source section information is available. * <p> * This method is thread-safe. * * @since 0.17 */ public SourceSection getSourceSection() { verifyValidState(true); return session.resolveSection(sourceSection); }
/** * Returns the source section location of this trace element. The source section is * <code>null</code> if the source location is not available. * * @since 1.0 */ public SourceSection getSourceSection() { Node node = traceElement.getLocation(); if (node != null) { return session.resolveSection(node.getEncapsulatingSourceSection()); } return null; }
/** * Get a source section representing this scope. Please note that while this scope does not * provide variables that are valid only after the suspension point, the source section can * actually span after the suspension point. * * @return the source section, or <code>null</code> when not available. * @throws DebugException when guest language code throws an exception * @since 0.29 */ public SourceSection getSourceSection() throws DebugException { try { Node node = scope.getNode(); if (node != null) { return session.resolveSection(node.getEncapsulatingSourceSection()); } else { return null; } } catch (ThreadDeath td) { throw td; } catch (Throwable ex) { throw new DebugException(session, ex, language, null, true, null); } }
/** * Returns the source section of the location where the debugging session was suspended. The * source section is <code>null</code> if the source location is not available. * * <p> * This method is thread-safe. * * @since 0.17 */ public SourceSection getSourceSection() { verifyValidState(true); if (currentFrame == null) { SuspendedContext context = getContext(); return event.getSession().resolveSection(context.getInstrumentedSourceSection()); } else { Node callNode = currentFrame.getCallNode(); if (callNode != null) { return event.getSession().resolveSection(callNode.getEncapsulatingSourceSection()); } return null; } }
/** * Get a source location where this value is declared, if any. * * @return a source location of the object, or <code>null</code> * @throws DebugException when guest language code throws an exception * @since 0.22 */ public final SourceSection getSourceLocation() throws DebugException { if (!isReadable()) { return null; } Object obj = get(); if (obj == null) { return null; } TruffleInstrument.Env env = getDebugger().getEnv(); LanguageInfo languageInfo = resolveLanguage(); if (languageInfo != null) { try { SourceSection location = env.findSourceLocation(languageInfo, obj); return getSession().resolveSection(location); } catch (ThreadDeath td) { throw td; } catch (Throwable ex) { throw new DebugException(getSession(), ex, languageInfo, null, true, null); } } else { return null; } }