if (ignoreLanguageContextInitialization.get() && !source.getContext().isLanguageContextInitialized()) { return;
/** * Set whether breakpoints of the given kind are active in this session. This has no effect on * breakpoints enabled/disabled state. Breakpoints need to be active to actually break the * execution. The breakpoints are active by default. * * @param breakpointKind the kind of breakpoints to activate/deactivate * @param active <code>true</code> to make breakpoints active, <code>false</code> to make * breakpoints inactive. * @since 1.0 */ public void setBreakpointsActive(Breakpoint.Kind breakpointKind, boolean active) { switch (breakpointKind) { case SOURCE_LOCATION: locationBreakpointsActive.set(active); break; case EXCEPTION: exceptionBreakpointsActive.set(active); break; case HALT_INSTRUCTION: alwaysHaltBreakpointsActive.set(active); break; default: CompilerDirectives.transferToInterpreter(); throw new IllegalStateException("Unhandled breakpoint kind: " + breakpointKind); } }
if (ignoreLanguageContextInitialization.get() && !source.getContext().isLanguageContextInitialized()) { return returnValue;
private Object notifyCallerReturn(SteppingStrategy s, DebuggerNode source, SuspendAnchor suspendAnchor, Object returnValue) { if (ignoreLanguageContextInitialization.get() && !source.getContext().isLanguageContextInitialized()) { return returnValue;
if (stepping.get()) { EventBinding<? extends ExecutionEventNodeFactory> localSyntaxElementBinding = syntaxElementsBinding; if (localSyntaxElementBinding != null) {
/** * Test whether breakpoints of the given kind are active in this session. Breakpoints do not * break execution when not active. * * @param breakpointKind the kind of breakpoints to test * @since 1.0 */ public boolean isBreakpointsActive(Breakpoint.Kind breakpointKind) { switch (breakpointKind) { case SOURCE_LOCATION: return locationBreakpointsActive.get(); case EXCEPTION: return exceptionBreakpointsActive.get(); case HALT_INSTRUCTION: return alwaysHaltBreakpointsActive.get(); default: CompilerDirectives.transferToInterpreter(); throw new IllegalStateException("Unhandled breakpoint kind: " + breakpointKind); } }
/** * Set a stepping suspension filter. Prepared steps skip code that does not match this filter. * * @since 0.26 */ public void setSteppingFilter(SuspensionFilter steppingFilter) { this.ignoreLanguageContextInitialization.set(steppingFilter.isIgnoreLanguageContextInitialization()); synchronized (this) { boolean oldIncludeInternal = this.includeInternal; this.includeInternal = steppingFilter.isInternalIncluded(); Predicate<Source> oldSourceFilter = this.sourceFilter; this.sourceFilter = steppingFilter.getSourcePredicate(); if (oldIncludeInternal != this.includeInternal || oldSourceFilter != this.sourceFilter) { removeBindings(); addBindings(this.includeInternal, this.sourceFilter); } } }
/** * Set a stepping suspension filter. Prepared steps skip code that match this filter. * * @since 0.26 */ public void setSteppingFilter(SuspensionFilter steppingFilter) { this.ignoreLanguageContextInitialization.set(steppingFilter.isIgnoreLanguageContextInitialization()); synchronized (this) { boolean oldIncludeInternal = this.includeInternal; this.includeInternal = steppingFilter.isInternalIncluded(); Predicate<Source> oldSourceFilter = this.sourceFilter; this.sourceFilter = steppingFilter.getSourcePredicate(); if (oldIncludeInternal != this.includeInternal || oldSourceFilter != this.sourceFilter) { removeBindings(); addBindings(this.includeInternal, this.sourceFilter); } } }
private void updateStepping() { assert Thread.holdsLock(this); boolean needsStepping = suspendNext || suspendAll; if (!needsStepping) { // iterating concurrent hashmap should be save for (Thread t : strategyMap.keySet()) { SteppingStrategy s = strategyMap.get(t); assert s != null; if (!s.isDone()) { needsStepping = true; break; } } } stepping.set(needsStepping); }
private void updateStepping() { assert Thread.holdsLock(this); boolean needsStepping = suspendNext || suspendAll; if (!needsStepping) { // iterating concurrent hashmap should be save for (Thread t : strategyMap.keySet()) { SteppingStrategy s = strategyMap.get(t); assert s != null; if (!s.isDone()) { needsStepping = true; break; } } } stepping.set(needsStepping); }
@TruffleBoundary private void doResetReportedException() { Throwable exception = exceptionsOnThreads.get(); synchronized (this) { if (exception != null) { exceptionsOnThreads.remove(); reportedExceptions.remove(exception); } if (reportedExceptions.isEmpty()) { haveReportedExceptions.set(false); } } }
@Override public void onReturnExceptional(VirtualFrame frame, Throwable exception) { if (stepping.get()) { doReturn(); } }
@Override protected void onReturnValue(VirtualFrame frame, Object result) { if (stepping.get()) { Object newResult = doStepAfter(frame.materialize(), result); if (newResult != result) { CompilerDirectives.transferToInterpreter(); throw getContext().createUnwind(new ChangedReturnInfo(newResult)); } } }
@Override public void onReturnExceptional(VirtualFrame frame, Throwable exception) { if (stepping.get()) { doReturn(); } }
@Override protected void onEnter(VirtualFrame frame) { if (stepping.get()) { doEnter(); } }
@Override protected void onReturnValue(VirtualFrame frame, Object result) { if (stepping.get()) { doStepAfter(frame.materialize(), result); } }
@Override protected Object onUnwind(VirtualFrame frame, Object info) { Object ret = super.onUnwind(frame, info); if (ret != null) { return ret; } if (stepping.get()) { return doUnwind(frame.materialize()); } else { return null; } }
@Override protected void onReturnExceptional(VirtualFrame frame, Throwable exception) { if (stepping.get()) { doStepAfter(frame.materialize(), exception); } }
@Override protected void onEnter(VirtualFrame frame) { if (stepping.get()) { doStepBefore(frame.materialize()); } }
@Override public void onReturnExceptional(VirtualFrame frame, Throwable exception) { if (stepping.get()) { doReturn(frame.materialize(), null); } }