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();
}
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);
}
}
}
Aggregations