@Override boolean step(DebuggerSession steppingSession, EventContext context, SuspendAnchor suspendAnchor) { boolean hit = current.step(steppingSession, context, suspendAnchor); if (hit) { if (current == last) { return true; } else { current = current.next; current.initialize(SuspendedContext.create(context, steppingSession.getDebugger().getEnv()), suspendAnchor); } } return false; }
@Override public SuspendedContext get() { return SuspendedContext.create(source.getContext(), debugger.getEnv()); } });
Debugger(Env env) { this.env = env; this.msgNodes = new ObjectStructures.MessageNodes(); this.alwaysHaltBreakpoint = new Breakpoint(BreakpointLocation.ANY, SuspendAnchor.BEFORE, false, null); this.alwaysHaltBreakpoint.setEnabled(true); }
final LanguageInfo resolveLanguage() { LanguageInfo languageInfo; if (preferredLanguage != null) { languageInfo = preferredLanguage; } else if (getScope() != null && getScope().getLanguage() != null) { languageInfo = getScope().getLanguage(); } else { languageInfo = getOriginalLanguage(); } return languageInfo; }
/** * Returns <code>true</code> if the underlying guest language source location is denoted as the * source element. * * @param sourceElement the source element to check, must not be <code>null</code>. * @since 0.33 */ public boolean hasSourceElement(SourceElement sourceElement) { return context.hasTag(sourceElement.getTag()); }
/** * Test if the language context of the source of the event is initialized. * * @since 0.26 */ public boolean isLanguageContextInitialized() { verifyValidState(true); return context.isLanguageContextInitialized(); }
@Override public void onContextClosed(TruffleContext context) { DebugContextsListener l = contextsListener; if (l != null) { DebugContext dc = getCachedDebugContext(context); l.contextClosed(dc); } }
@Override public void onLanguageContextInitialized(TruffleContext context, LanguageInfo language) { DebugContextsListener l = contextsListener; if (l != null) { DebugContext dc = getCachedDebugContext(context); l.languageContextInitialized(dc, language); } }
private SuspendedContext getContext() { SuspendedContext context = event.getContext(); if (context == null) { // there is a race condition here if the event // got disposed between the parent verifyValidState and getContext. // if the context is null we assume the event got disposed so we re-check // the disposed flag. return null should therefore not be reachable. verifyValidState(true); assert false : "should not be reachable"; } return context; }
AbstractBreakpointNode(Breakpoint breakpoint, EventContext context) { super(context); this.breakpoint = breakpoint; initializeSessions(); this.conditionExistsUnchanged = breakpoint.getConditionExistsUnchanged(); if (breakpoint.condition != null) { this.breakCondition = new ConditionalBreakNode(context, breakpoint); } }
@Override public void onThreadInitialized(TruffleContext context, Thread thread) { DebugThreadsListener l = threadsListener; if (l != null) { DebugContext dc = getCachedDebugContext(context); l.threadInitialized(dc, thread); } }
@Override public void onLanguageContextFinalized(TruffleContext context, LanguageInfo language) { DebugContextsListener l = contextsListener; if (l != null) { DebugContext dc = getCachedDebugContext(context); l.languageContextFinalized(dc, language); } }
@Override public void onThreadDisposed(TruffleContext context, Thread thread) { DebugThreadsListener l = threadsListener; if (l != null) { DebugContext dc = getCachedDebugContext(context); l.threadDisposed(dc, thread); } }
/** * 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); }
void resetReportedException() { if (haveReportedExceptions.get()) { doResetReportedException(); } }
Debugger(Env env) { this.env = env; this.msgNodes = new ObjectStructures.MessageNodes(); this.alwaysHaltBreakpoint = new Breakpoint(BreakpointLocation.ANY, SuspendAnchor.BEFORE); this.alwaysHaltBreakpoint.setEnabled(true); }
/** * Returns <code>true</code> if the underlying guest language source location is denoted as the * source element. * * @param sourceElement the source element to check, must not be <code>null</code>. * @since 0.33 */ public boolean hasSourceElement(SourceElement sourceElement) { return context.hasTag(sourceElement.getTag()); }
/** * Test if the language context of the source of the event is initialized. * * @since 0.26 */ public boolean isLanguageContextInitialized() { verifyValidState(true); return context.isLanguageContextInitialized(); }
@Override public void onContextClosed(TruffleContext context) { DebugContextsListener l = contextsListener; if (l != null) { DebugContext dc = getCachedDebugContext(context); l.contextClosed(dc); } }