@TruffleBoundary private void doReturn(MaterializedFrame frame, Object result) { SteppingStrategy steppingStrategy = strategyMap.get(Thread.currentThread()); if (steppingStrategy != null && steppingStrategy.isStopAfterCall()) { notifyCallback(this, frame, SuspendAnchor.AFTER, null, result, null); } }
@TruffleBoundary private void doStepBefore(MaterializedFrame frame) { SuspendAnchor anchor = SuspendAnchor.BEFORE; SteppingStrategy steppingStrategy; if (suspendNext || suspendAll || (steppingStrategy = getSteppingStrategy(Thread.currentThread())) != null && steppingStrategy.isActiveOnStepTo(context, anchor)) { notifyCallback(this, frame, anchor, null, null, null, null); } }
@TruffleBoundary protected final Object doStepAfter(MaterializedFrame frame, Object result) { SuspendAnchor anchor = SuspendAnchor.AFTER; SteppingStrategy steppingStrategy = getSteppingStrategy(Thread.currentThread()); if (steppingStrategy != null && steppingStrategy.isActiveOnStepTo(context, anchor)) { return notifyCallback(this, frame, anchor, this, result, null, null); } return result; }
@TruffleBoundary private void doStepAfter(MaterializedFrame frame, Object result) { SuspendAnchor anchor = SuspendAnchor.AFTER; SteppingStrategy steppingStrategy = getSteppingStrategy(Thread.currentThread()); if (steppingStrategy != null && steppingStrategy.isActiveOnStepTo(context, anchor)) { notifyCallback(this, frame, anchor, this, result, null); } }
@TruffleBoundary private void doStepBefore(MaterializedFrame frame) { SuspendAnchor anchor = SuspendAnchor.BEFORE; SteppingStrategy steppingStrategy; if (suspendNext || suspendAll || (steppingStrategy = getSteppingStrategy(Thread.currentThread())) != null && steppingStrategy.isActiveOnStepTo(context, anchor)) { notifyCallback(this, frame, anchor, null, null, null); } }
@TruffleBoundary @SuppressWarnings("hiding") // We want to mask "sessions", as we recieve preferred ones private void doBreak(DebuggerNode source, DebuggerSession[] sessions, MaterializedFrame frame, boolean onEnter, Object result, BreakpointConditionFailure failure) { if (!isEnabled()) { // make sure we do not cause break events if we got disabled already // the instrumentation framework will make sure that this is not happening if the // binding was disposed. return; } SuspendAnchor anchor = onEnter ? SuspendAnchor.BEFORE : SuspendAnchor.AFTER; for (DebuggerSession session : sessions) { if (session.isBreakpointsActive()) { session.notifyCallback(source, frame, anchor, null, result, failure); } } }
@TruffleBoundary private Object doBreak(DebuggerNode source, DebuggerSession[] breakInSessions, MaterializedFrame frame, boolean onEnter, Object result, Throwable exception, Node throwLocation, boolean isCatchNodeComputed, DebugException.CatchLocation catchLocation, BreakpointConditionFailure failure) { if (!isEnabled()) { // make sure we do not cause break events if we got disabled already // the instrumentation framework will make sure that this is not happening if the // binding was disposed. return result; } if (this.hitCount.incrementAndGet() <= ignoreCount) { // breakpoint hit was ignored return result; } SuspendAnchor anchor = onEnter ? SuspendAnchor.BEFORE : SuspendAnchor.AFTER; Object newResult = result; for (DebuggerSession session : breakInSessions) { if (session.isBreakpointsActive(getKind())) { DebugException de; if (exception != null) { de = new DebugException(session, exception, null, throwLocation, isCatchNodeComputed, catchLocation); } else { de = null; } newResult = session.notifyCallback(source, frame, anchor, null, newResult, de, failure); } } return newResult; }