Search in sources :

Example 1 with IStackWalkerCallbacks

use of com.ibm.j9ddr.vm29.j9.stackwalker.IStackWalkerCallbacks in project openj9 by eclipse.

the class GCVMThreadStackSlotIterator method scanSlots.

static void scanSlots(J9VMThreadPointer walkThread, IStackWalkerCallbacks stackWalkerCallbacks, boolean includeStackFrameClassReferences, boolean trackVisibleFrameDepth) {
    WalkState walkState = new WalkState();
    walkState.flags = J9_STACKWALK_ITERATE_O_SLOTS | J9_STACKWALK_DO_NOT_SNIFF_AND_WHACK;
    walkState.walkThread = walkThread;
    walkState.callBacks = stackWalkerCallbacks;
    if (trackVisibleFrameDepth) {
        walkState.skipCount = 0;
        walkState.flags |= J9_STACKWALK_VISIBLE_ONLY;
    } else {
        walkState.flags |= J9_STACKWALK_SKIP_INLINES;
    }
    if (includeStackFrameClassReferences) {
        walkState.flags |= J9_STACKWALK_ITERATE_METHOD_CLASS_SLOTS;
    }
    StackWalkResult result = StackWalkResult.STACK_CORRUPT;
    result = StackWalker.walkStackFrames(walkState);
    if (StackWalkResult.NONE != result) {
        /* Explicitly raising a corrupt data event here since returning StackWalkResult.STACK_CORRUPT is fairly common if a core is not taken at a safe gc point */
        CorruptDataException corruptDataException = new CorruptDataException("Stack walk returned: " + result + " for vmThread: " + walkThread.getHexAddress());
        EventManager.raiseCorruptDataEvent("", corruptDataException, false);
    }
}
Also used : WalkState(com.ibm.j9ddr.vm29.j9.stackwalker.WalkState) CorruptDataException(com.ibm.j9ddr.CorruptDataException) StackWalkResult(com.ibm.j9ddr.vm29.j9.stackwalker.StackWalkResult)

Aggregations

CorruptDataException (com.ibm.j9ddr.CorruptDataException)1 StackWalkResult (com.ibm.j9ddr.vm29.j9.stackwalker.StackWalkResult)1 WalkState (com.ibm.j9ddr.vm29.j9.stackwalker.WalkState)1