Search in sources :

Example 1 with StructureTypeManager

use of com.ibm.j9ddr.StructureTypeManager in project openj9 by eclipse.

the class StructureCommandUtil method loadStructureMap.

private static void loadStructureMap() {
    structureMap = new HashMap<String, StructureDescriptor>();
    for (StructureDescriptor descriptor : cachedContext.vmData.getStructures()) {
        structureMap.put(descriptor.getName().toLowerCase(), descriptor);
    }
    typeManager = new StructureTypeManager(cachedContext.vmData.getStructures());
    StringBuilder b = new StringBuilder();
    b.append("0x%0");
    b.append(2 * cachedContext.process.bytesPerPointer());
    b.append("X");
    pointerFormatString = b.toString();
}
Also used : StructureTypeManager(com.ibm.j9ddr.StructureTypeManager) StructureDescriptor(com.ibm.j9ddr.StructureReader.StructureDescriptor)

Example 2 with StructureTypeManager

use of com.ibm.j9ddr.StructureTypeManager in project openj9 by eclipse.

the class PointerGenerator method generateClasses.

private void generateClasses() {
    String fileName = opts.get("-f");
    String supersetFileName = opts.get("-s");
    try {
        J9DDRStructureStore store = new J9DDRStructureStore(fileName, supersetFileName);
        System.out.println("superset directory name : " + fileName);
        System.out.println("superset file name : " + store.getSuperSetFileName());
        InputStream inputStream = store.getSuperset();
        structureReader = new StructureReader(inputStream);
        inputStream.close();
    } catch (IOException e) {
        System.out.println("Problem with file: " + fileName);
        e.printStackTrace();
        return;
    }
    outputDir = getOutputDir("-p");
    if (opts.get("-h") != null) {
        // where to write the helpers to if the option is set
        outputDirHelpers = getOutputDir("-h");
    }
    typeManager = new StructureTypeManager(structureReader.getStructures());
    for (StructureDescriptor structure : structureReader.getStructures()) {
        try {
            if (FlagStructureList.isFlagsStructure(structure.getName())) {
                generateBuildFlags(structure);
            } else {
                generateClass(structure);
            }
        } catch (FileNotFoundException e) {
            String error = String.format("File Not Found processing: %s: %s", structure.getPointerName(), e.getMessage());
            System.out.println(error);
        } catch (IOException e) {
            String error = String.format("IOException processing: %s: %s", structure.getPointerName(), e.getMessage());
            System.out.println(error);
        }
    }
}
Also used : StructureTypeManager(com.ibm.j9ddr.StructureTypeManager) J9DDRStructureStore(com.ibm.j9ddr.tools.store.J9DDRStructureStore) FileInputStream(java.io.FileInputStream) InputStream(java.io.InputStream) StructureReader(com.ibm.j9ddr.StructureReader) FileNotFoundException(java.io.FileNotFoundException) IOException(java.io.IOException) StructureDescriptor(com.ibm.j9ddr.StructureReader.StructureDescriptor)

Aggregations

StructureDescriptor (com.ibm.j9ddr.StructureReader.StructureDescriptor)2 StructureTypeManager (com.ibm.j9ddr.StructureTypeManager)2 StructureReader (com.ibm.j9ddr.StructureReader)1 J9DDRStructureStore (com.ibm.j9ddr.tools.store.J9DDRStructureStore)1 FileInputStream (java.io.FileInputStream)1 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1