public void onSuspend(SuspendedEvent ev) { actualName[0] = ev.getTopStackFrame().getName(); haltCount[0] = haltCount[0] + 1; } })) {
/** * Returns the return value of the currently executed source location. Returns <code>null</code> * if the execution is suspended {@link SuspendAnchor#BEFORE before} a guest language location. * The returned value is <code>null</code> if an exception occurred during execution of the * instrumented source element, the exception is provided by {@link #getException()}. * <p> * This method is not thread-safe and will throw an {@link IllegalStateException} if called on * another thread than it was created with. * * @since 0.17 */ public DebugValue getReturnValue() { verifyValidState(false); Object ret = returnValue; if (ret == null) { return null; } return getTopStackFrame().wrapHeapValue(ret); }
/** * Returns the return value of the currently executed source location. Returns <code>null</code> * if the execution is suspended {@link SuspendAnchor#BEFORE before} a guest language location. * The returned value is <code>null</code> if an exception occurred during execution of the * instrumented source element. The debug value remains valid event if the current execution was * suspend. * <p> * This method is not thread-safe and will throw an {@link IllegalStateException} if called on * another thread than it was created with. * * @since 0.17 */ public DebugValue getReturnValue() { verifyValidState(false); Object ret = returnValue; if (ret == null) { return null; } return getTopStackFrame().wrapHeapValue(ret); }
/** * Returns the input values of the current source element gathered from return values of it's * executed children. The input values are available only during stepping through the source * elements hierarchy and only on {@link SuspendAnchor#AFTER AFTER} {@link #getSuspendAnchor() * suspend anchor}. There can be <code>null</code> values in the returned array for children we * did not intercept return values from. * * @return the array of input values, or <code>null</code> when no input is available. * @since 0.33 */ public DebugValue[] getInputValues() { if (inputValuesProvider == null) { return null; } Object[] inputValues = inputValuesProvider.getDebugInputValues(materializedFrame); int n = inputValues.length; DebugValue[] values = new DebugValue[n]; for (int i = 0; i < n; i++) { if (inputValues[i] != null) { values[i] = getTopStackFrame().wrapHeapValue(inputValues[i]); } else { values[i] = null; } } return values; }
/** * Returns the input values of the current source element gathered from return values of it's * executed children. The input values are available only during stepping through the source * elements hierarchy and only on {@link SuspendAnchor#AFTER AFTER} {@link #getSuspendAnchor() * suspend anchor}. There can be <code>null</code> values in the returned array for children we * did not intercept return values from. * * @return the array of input values, or <code>null</code> when no input is available. * @since 0.33 */ public DebugValue[] getInputValues() { if (inputValuesProvider == null) { return null; } Object[] inputValues = inputValuesProvider.getDebugInputValues(materializedFrame); int n = inputValues.length; DebugValue[] values = new DebugValue[n]; for (int i = 0; i < n; i++) { if (inputValues[i] != null) { values[i] = getTopStackFrame().wrapHeapValue(inputValues[i]); } else { values[i] = null; } } return values; }