Class StructureReader

java.lang.Object
com.ibm.j9ddr.StructureReader

public class StructureReader extends Object
  • Field Details

    • VERSION

      public static final int VERSION
      See Also:
    • J9_STRUCTURES_EYECATCHER

      public static final int J9_STRUCTURES_EYECATCHER
      See Also:
    • STRUCTURE_CONSTRUCTOR_SIGNATURE

      public static final Class<?>[] STRUCTURE_CONSTRUCTOR_SIGNATURE
    • BIT_FIELD_FORMAT_LITTLE_ENDIAN

      public static final byte BIT_FIELD_FORMAT_LITTLE_ENDIAN
      See Also:
    • BIT_FIELD_FORMAT_BIG_ENDIAN

      public static final byte BIT_FIELD_FORMAT_BIG_ENDIAN
      See Also:
    • BIT_FIELD_CELL_SIZE

      public static final int BIT_FIELD_CELL_SIZE
      See Also:
    • DDR_VERSIONED_PACKAGE_PREFIX

      public static final String DDR_VERSIONED_PACKAGE_PREFIX
      See Also:
  • Constructor Details

    • StructureReader

      public StructureReader(ImageInputStream in) throws IOException
      Initialize this reader from the supplied data. The ImageInputStream must be validated and already be positioned to point to the first byte of the DDR Structure Data. The ByteOrder of the ImageInputStream will be adjusted to match the file being read. (The DDR Structure data is written in the ByteOrder of the platform that created the core file.)
      Throws:
      IOException
    • StructureReader

      public StructureReader(InputStream in) throws IOException
      Read a stream in the J9DDRStructStore superset format.
      Throws:
      IOException
  • Method Details

    • getHeader

      public StructureHeader getHeader()
    • getBasePackage

      public String getBasePackage()
    • getPackageVersion

      public long getPackageVersion()
      Get the package version number, derived from fields of DDRAlgorithmVersions in the blob.
      Returns:
      the package version number
    • getPackageName

      public String getPackageName(StructureReader.PackageNameType type)
      Get the package name that should be used including the version information
      Parameters:
      type -
      Returns:
    • addCompatibilityConstants

      public void addCompatibilityConstants(InputStream inputStream) throws IOException
      Throws:
      IOException
    • loadAliasMap

      public static Map<String,String> loadAliasMap(long version) throws IOException
      Throws:
      IOException
    • loadAuxFieldInfo

      public void loadAuxFieldInfo(InputStream stream) throws IOException
      Throws:
      IOException
    • getStructureNames

      public Set<String> getStructureNames()
      Get a list of the structures defined by this reader
      Returns:
      Set interface for the structure names
    • hasStructure

      public boolean hasStructure(String name)
      Test to see if a structure has been read in and hence available
      Parameters:
      name - name of the structure to look for
      Returns:
      true if the structure exists, false if not
    • getStructureSizeOf

      public int getStructureSizeOf(String structureName)
    • getStructures

    • getFields

      public List<StructureReader.FieldDescriptor> getFields(String structureName)
      Get a map of the fields for a particular structure and their offsets.
      Parameters:
      structureName - name of the structure
      Returns:
      map of the fields as FieldName, Offset pair
    • getConstants

      public List<StructureReader.ConstantDescriptor> getConstants(String structureName)
    • addStructures

      public void addStructures(ImageInputStream ddrStream) throws IOException
      Add to the existing set of structures already contained in this reader. Note that this will replace any definitions already contained within the reader.
      Parameters:
      ddrStream - stream to add the structures from
      Throws:
      IOException
    • getStructureClassBytes

      public byte[] getStructureClassBytes(String binaryName) throws ClassNotFoundException
      Throws:
      ClassNotFoundException
    • getPointerClassBytes

      public byte[] getPointerClassBytes(String binaryName) throws ClassNotFoundException
      Throws:
      ClassNotFoundException
    • getConstantValue

      public long getConstantValue(String structureName, String constantName, long defaultValue)
    • getBuildFlagValue

      public boolean getBuildFlagValue(String structureName, String constantName, boolean defaultValue)
    • getSizeOfBool

      public byte getSizeOfBool()
    • getSizeOfUDATA

      public byte getSizeOfUDATA()
    • getBitFieldFormat

      public byte getBitFieldFormat()
    • simplifyType

      public static String simplifyType(String type)