- java.lang.Object
-
- com.ibm.j9ddr.vm29.j9.stackwalker.StackWalkerUtils
-
public class StackWalkerUtils extends Object
Utility methods shared between stack walkers.
-
-
Field Summary
Fields Modifier and Type Field Description static boolean
DEBUG_LOCALMAP
static boolean
DEBUG_STACKMAP
static int
INITIAL_O_SLOTS_CORRUPTION_THRESHOLD
Number of CorruptDataExceptions from iterate-o-slots logic that we report before disabling the o-slots walkstatic Logger
logger
Stack walker logger, can be enabled for debugging stack walker issues when running inside other tools, for example Memory Analyzer.
-
Constructor Summary
Constructors Constructor Description StackWalkerUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
disableVerboseLogging()
static void
enableVerboseLogging(int level)
Enables stackwalk verbose logging through j.u.logging - similar in appearance to -verbose:stackwalk output from native.static void
enableVerboseLogging(int level, PrintStream os)
static void
handleOSlotsCorruption(WalkState walkState, String className, String methodName, CorruptDataException ex)
Since walking OSlots touches a lot more code than just doing a frame walk, we have a layer of corruption handling just above the o-slots logic.static UDATA
JIT_RESOLVE_PARM(WalkState walkState, int parmNumber)
static boolean
oSlotsCorruptionThresholdReached()
static void
resetOSlotsCorruptionThreshold()
static void
swPrintf(WalkState walkState, int level, String message, Object... args)
This function is a little overloaded.static void
swPrintMethod(WalkState walkState)
static void
swPrintMethod(WalkState walkState, com.ibm.j9ddr.vm29.pointer.generated.J9MethodPointer method)
static void
WALK_I_SLOT(WalkState walkState, PointerPointer slot)
static void
WALK_INDIRECT_I_SLOT(WalkState walkState, PointerPointer slot, VoidPointer ind)
static void
WALK_INDIRECT_O_SLOT(WalkState walkState, PointerPointer slot, VoidPointer ind)
static void
WALK_METHOD_CLASS(WalkState walkState)
static void
WALK_NAMED_I_SLOT(WalkState walkState, PointerPointer slot, String tag)
static void
WALK_NAMED_INDIRECT_I_SLOT(WalkState walkState, PointerPointer intSlot, VoidPointer indirectSlot, String tag)
static void
WALK_NAMED_INDIRECT_O_SLOT(WalkState walkState, PointerPointer objectSlot, VoidPointer indirectSlot, String tag)
static void
WALK_NAMED_O_SLOT(WalkState walkState, PointerPointer slot, String tag)
static void
WALK_O_SLOT(WalkState walkState, PointerPointer slot)
-
-
-
Field Detail
-
logger
public static final Logger logger
Stack walker logger, can be enabled for debugging stack walker issues when running inside other tools, for example Memory Analyzer.
-
INITIAL_O_SLOTS_CORRUPTION_THRESHOLD
public static final int INITIAL_O_SLOTS_CORRUPTION_THRESHOLD
Number of CorruptDataExceptions from iterate-o-slots logic that we report before disabling the o-slots walk- See Also:
- Constant Field Values
-
DEBUG_STACKMAP
public static final boolean DEBUG_STACKMAP
- See Also:
- Constant Field Values
-
DEBUG_LOCALMAP
public static final boolean DEBUG_LOCALMAP
- See Also:
- Constant Field Values
-
-
Method Detail
-
swPrintf
public static void swPrintf(WalkState walkState, int level, String message, Object... args)
This function is a little overloaded. As well as determining if a message should be printed out for the message level chosen by the tool running the stack walker we also allow for someone turning on logging for debug to get details about the stack walker while running (for example) Memory Analyzer.- Parameters:
walkState
-level
-message
-args
-
-
swPrintMethod
public static void swPrintMethod(WalkState walkState) throws CorruptDataException
- Throws:
CorruptDataException
-
swPrintMethod
public static void swPrintMethod(WalkState walkState, com.ibm.j9ddr.vm29.pointer.generated.J9MethodPointer method) throws CorruptDataException
- Throws:
CorruptDataException
-
WALK_METHOD_CLASS
public static void WALK_METHOD_CLASS(WalkState walkState) throws CorruptDataException
- Throws:
CorruptDataException
-
WALK_NAMED_INDIRECT_O_SLOT
public static void WALK_NAMED_INDIRECT_O_SLOT(WalkState walkState, PointerPointer objectSlot, VoidPointer indirectSlot, String tag) throws CorruptDataException
- Throws:
CorruptDataException
-
WALK_NAMED_INDIRECT_I_SLOT
public static void WALK_NAMED_INDIRECT_I_SLOT(WalkState walkState, PointerPointer intSlot, VoidPointer indirectSlot, String tag) throws CorruptDataException
- Throws:
CorruptDataException
-
WALK_INDIRECT_O_SLOT
public static void WALK_INDIRECT_O_SLOT(WalkState walkState, PointerPointer slot, VoidPointer ind) throws CorruptDataException
- Throws:
CorruptDataException
-
WALK_INDIRECT_I_SLOT
public static void WALK_INDIRECT_I_SLOT(WalkState walkState, PointerPointer slot, VoidPointer ind) throws CorruptDataException
- Throws:
CorruptDataException
-
WALK_NAMED_O_SLOT
public static void WALK_NAMED_O_SLOT(WalkState walkState, PointerPointer slot, String tag) throws CorruptDataException
- Throws:
CorruptDataException
-
WALK_NAMED_I_SLOT
public static void WALK_NAMED_I_SLOT(WalkState walkState, PointerPointer slot, String tag) throws CorruptDataException
- Throws:
CorruptDataException
-
WALK_O_SLOT
public static void WALK_O_SLOT(WalkState walkState, PointerPointer slot) throws CorruptDataException
- Throws:
CorruptDataException
-
WALK_I_SLOT
public static void WALK_I_SLOT(WalkState walkState, PointerPointer slot) throws CorruptDataException
- Throws:
CorruptDataException
-
JIT_RESOLVE_PARM
public static UDATA JIT_RESOLVE_PARM(WalkState walkState, int parmNumber) throws CorruptDataException
- Throws:
CorruptDataException
-
resetOSlotsCorruptionThreshold
public static void resetOSlotsCorruptionThreshold()
-
oSlotsCorruptionThresholdReached
public static boolean oSlotsCorruptionThresholdReached()
-
handleOSlotsCorruption
public static void handleOSlotsCorruption(WalkState walkState, String className, String methodName, CorruptDataException ex)
Since walking OSlots touches a lot more code than just doing a frame walk, we have a layer of corruption handling just above the o-slots logic. We have oslotsCorruptionThreshold attempts, then give up. This method is called in the catch block just below the top-level if (J9_STACKWALK_ITERATE_O_SLOTS) {} conditional.
-
enableVerboseLogging
public static void enableVerboseLogging(int level)
Enables stackwalk verbose logging through j.u.logging - similar in appearance to -verbose:stackwalk output from native.
-
enableVerboseLogging
public static void enableVerboseLogging(int level, PrintStream os)
-
disableVerboseLogging
public static void disableVerboseLogging()
-
-