Class CommandUtils
java.lang.Object
com.ibm.j9ddr.tools.ddrinteractive.CommandUtils
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final int
static final int
static final int
static final BigInteger
static final BigInteger
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
dbgError
(PrintStream out, String msg) static void
dbgPrint
(PrintStream out, String msg) static void
dbgPrint
(PrintStream out, String msg, Object... args) static boolean
fieldExists
(Class<?> class1, String string) static long
followPointerFromStructure
(Context context, String structureName, long structureAddress, String fieldName) static String
getCStringAtAddress
(IProcess process, long address) static String
getCStringAtAddress
(IProcess process, long address, long maxLength) static Logger
static long
getOffsetForField
(StructureReader.StructureDescriptor desc, String fieldName) static BigInteger
longToBigInteger
(long pointer) This method converts long type pointer into BigInteger instance.static byte[]
longToByteArray
(long index, int size) static BigInteger
parseNumber
(String number) This method parses given number into a BigIntegerstatic long
parsePointer
(String input, boolean is64bit) This method parses the given address string and return the address value in type long.
-
Field Details
-
UDATA_MAX_64BIT
-
UDATA_MAX_32BIT
-
RADIX_BINARY
public static final int RADIX_BINARY- See Also:
-
RADIX_DECIMAL
public static final int RADIX_DECIMAL- See Also:
-
RADIX_HEXADECIMAL
public static final int RADIX_HEXADECIMAL- See Also:
-
HEX_SUFFIX
- See Also:
-
-
Constructor Details
-
CommandUtils
public CommandUtils()
-
-
Method Details
-
parsePointer
public static long parsePointer(String input, boolean is64bit) throws DDRInteractiveCommandException This method parses the given address string and return the address value in type long.- Parameters:
input
- String representation of the address of a pointer.is64bit
- True, if the platform where core file is generated is 64 bit platform. False, otherwise.- Returns:
- Address of the parsed pointer. Return 0, if any parse error occurs.
- Throws:
DDRInteractiveCommandException
-
longToBigInteger
This method converts long type pointer into BigInteger instance. Since long type pointer can be negative too, such values converted into positive BigInteger by treating the bits of long as UDATA.- Parameters:
pointer
- long data type pointer.- Returns:
- BigInteger instance of the given pointer
-
parseNumber
This method parses given number into a BigInteger- Parameters:
number
- String representation of the given number to be parsed- Returns:
- BigInteger instance of the parsed number
- Throws:
DDRInteractiveCommandException
-
getLogger
-
followPointerFromStructure
public static long followPointerFromStructure(Context context, String structureName, long structureAddress, String fieldName) throws MemoryFault, DDRInteractiveCommandException -
getOffsetForField
public static long getOffsetForField(StructureReader.StructureDescriptor desc, String fieldName) throws NoSuchFieldException - Throws:
NoSuchFieldException
-
getCStringAtAddress
public static String getCStringAtAddress(IProcess process, long address) throws CorruptDataException - Throws:
CorruptDataException
-
fieldExists
-
getCStringAtAddress
public static String getCStringAtAddress(IProcess process, long address, long maxLength) throws CorruptDataException - Throws:
CorruptDataException
-
dbgError
-
dbgPrint
-
dbgPrint
-
longToByteArray
public static byte[] longToByteArray(long index, int size)
-