@Override public String getLocationDescription() { return delegate.getLocationDescription(); }
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); }
@Override public String getCondition() { return delegate.getCondition(); }
/** * Controls whether this breakpoint is currently allowed to suspend execution (true by default). * This can be changed arbitrarily until breakpoint is {@linkplain #dispose() disposed}. * <p> * When not {@link #isModifiable() modifiable}, {@link IllegalStateException} is thrown. * * @param enabled whether this breakpoint should be allowed to suspend execution * * @since 0.9 */ public synchronized void setEnabled(boolean enabled) { if (disposed) { // cannot enable disposed breakpoints return; } if (this.enabled != enabled) { if (!sessions.isEmpty()) { if (enabled) { install(); } else { uninstall(); } } this.enabled = enabled; } }
for (DebuggerNode node : nodes) { Breakpoint breakpoint = node.getBreakpoint(); if (breakpoint == null || !isBreakpointsActive(breakpoint.getKind())) { continue; // not a breakpoint node BreakpointConditionFailure failure = null; try { hit = breakpoint.notifyIndirectHit(source, node, frame, exception); } catch (BreakpointConditionFailure e) { failure = e; breaks = new ArrayList<>(); breaks.add(breakpoint.isGlobal() ? breakpoint.getROWrapper() : breakpoint); if (fb.isGlobal()) { fb = fb.getROWrapper();
if (breakpoint.isDisposed()) { throw new IllegalArgumentException("Cannot install breakpoint, it is already disposed."); breakpoint.installGlobal(this); DebuggerSession[] ds; synchronized (this) { listener.accept(breakpoint.getROWrapper());
BreakpointConditionFailure failure = null; try { hit = breakpoint.notifyIndirectHit(source, node, frame); } catch (BreakpointConditionFailure e) { failure = e; breaks = new ArrayList<>(); breaks.add(breakpoint.isGlobal() ? breakpoint.getROWrapper() : breakpoint); if (fb.isGlobal()) { fb = fb.getROWrapper();
/** * @return a new breakpoint instance of {@link Kind#SOURCE_LOCATION SOURCE_LOCATION} kind. * * @since 0.17 */ public Breakpoint build() { if (sourceElements == null) { sourceElements = new SourceElement[]{SourceElement.STATEMENT}; } BreakpointLocation location; if (sourceSection != null) { location = BreakpointLocation.create(key, sourceElements, sourceSection); } else { location = BreakpointLocation.create(key, sourceElements, line, column); } Breakpoint breakpoint = new Breakpoint(location, anchor, oneShot, null, resolveListener); breakpoint.setIgnoreCount(ignoreCount); return breakpoint; }
synchronized boolean install(DebuggerSession d, boolean failOnError) { if (disposed) { if (failOnError) { throw new IllegalArgumentException("Cannot install breakpoint, it is disposed already."); } else { return false; } } if (this.sessions.contains(d)) { if (failOnError) { throw new IllegalStateException("Breakpoint is already installed in the session."); } else { return true; } } install(d.getDebugger()); this.sessions.add(d); sessionsAssumptionInvalidate(); if (enabled) { install(); } return true; }
if (breakpoint.isDisposed()) { throw new IllegalArgumentException("Cannot install breakpoint, it is already disposed."); breakpoint.installGlobal(this); DebuggerSession[] ds; synchronized (this) {
@Override public Object getNewValue() { Breakpoint breakpoint = (Breakpoint) super.getNewValue(); if (breakpoint != null) { breakpoint = breakpoint.getROWrapper(); } return breakpoint; }
breakpointFailures = new HashMap<>(); Breakpoint fb = conditionFailure.getBreakpoint(); if (fb.isGlobal()) { fb = fb.getROWrapper();
synchronized (breakpoints) { for (Breakpoint b : breakpoints) { if (suspendAnchor == b.getSuspendAnchor()) { DebuggerNode node = b.lookupNode(context); if (node != null) { nodes.add(node); if (suspendAnchor == b.getSuspendAnchor()) { DebuggerNode node = b.lookupNode(context); if (node != null) { nodes.add(node); DebuggerNode node = debugger.alwaysHaltBreakpoint.lookupNode(context); if (node != null) { nodes.add(node);
synchronized void installGlobal(Debugger d) { if (disposed) { throw new IllegalArgumentException("Cannot install breakpoint, it is disposed already."); } if (this.debugger != null) { throw new IllegalStateException("Breakpoint is already installed in a Debugger instance."); } install(d); this.global = true; }
for (DebuggerNode node : nodes) { Breakpoint breakpoint = node.getBreakpoint(); if (breakpoint == null || isBreakpointsActive(breakpoint.getKind()) && breakpoint.getCondition() == null) {
@Override public int getIgnoreCount() { return delegate.getIgnoreCount(); }
@Override public SuspendAnchor getSuspendAnchor() { return delegate.getSuspendAnchor(); }
@Override public boolean isDisposed() { return delegate.isDisposed(); }
@Override public int getHitCount() { return delegate.getHitCount(); }
/** * @return a new breakpoint instance of {@link Kind#EXCEPTION EXCEPTION} kind. * * @since 1.0 */ public Breakpoint build() { if (sourceElements == null) { sourceElements = new SourceElement[]{SourceElement.STATEMENT}; } BreakpointLocation location = BreakpointLocation.create(sourceElements, suspensionFilter); BreakpointExceptionFilter efilter = new BreakpointExceptionFilter(caught, uncaught); return new Breakpoint(location, SuspendAnchor.AFTER, false, efilter, null); } }