use of com.ibm.dtfj.image.Image in project openj9 by eclipse.
the class JCImageFactory method getImage.
/**
*/
public Image getImage(File arg0) throws IOException {
InputStream stream = new FileInputStream(arg0);
try {
Image image = new JavaCoreReader(new ImageBuilderFactory()).generateImage(stream);
// following cast is safe since examining the code path from generateImage
// shows that what comes back can only be the JCImage from
// com.ibm.dtfj.javacore.builder.javacore.ImageBuilder, instance variable _fImage
((JCImage) image).setSource(arg0.toURI());
return image;
} finally {
stream.close();
}
}
use of com.ibm.dtfj.image.Image in project openj9 by eclipse.
the class JCImageFactory method getImage.
public Image getImage(final ImageInputStream in, URI sourceID) throws IOException {
InputStream stream = new InputStream() {
public int read() throws IOException {
return in.read();
}
};
try {
Image image = new JavaCoreReader(new ImageBuilderFactory()).generateImage(stream);
((JCImage) image).setSource(sourceID);
return image;
} finally {
in.close();
}
}
use of com.ibm.dtfj.image.Image in project openj9 by eclipse.
the class DTFJWalker method walkCoreFile.
public void walkCoreFile(File file) {
// the factory will have to be on the classpath as it is in the same jar as this class
J9DDRImageFactory factory = new J9DDRImageFactory();
Image image = null;
try {
image = factory.getImage(file);
} catch (IOException e) {
System.err.println("Failed to create an Image from the core file : " + e.getMessage());
logger.log(Level.WARNING, "Failed to create Image from core file", e);
return;
}
try {
Method iterator = image.getClass().getDeclaredMethod("getAddressSpaces", (Class[]) null);
iterate(image, iterator, 100);
} catch (Exception e) {
System.err.println("Failed to get address space iterator method : " + e.getMessage());
logger.log(Level.WARNING, "Failed to get address space iterator method", e);
return;
}
System.out.println("Walk complete");
showResults();
}
use of com.ibm.dtfj.image.Image in project openj9 by eclipse.
the class PHDImageFactory method getImage.
public Image getImage(ImageInputStream in, ImageInputStream meta, URI sourceID) throws IOException {
ImageFactory metaFactory = getMetaFactory();
Image metaImage = metaFactory.getImage(meta, sourceID);
return new PHDImage(sourceID, in, metaImage);
}
use of com.ibm.dtfj.image.Image in project openj9 by eclipse.
the class ImageTest method getSystemTypeTest.
@Test
public void getSystemTypeTest() {
for (int i = 0; i != ddrTestObjects.size(); i++) {
Image ddrImg = (Image) ddrTestObjects.get(i);
Image jextractImg = (Image) jextractTestObjects.get(i);
imageComparator.testEquals(ddrImg, jextractImg, ImageComparator.SYSTEM_TYPE);
}
}
Aggregations