Search in sources :

Example 1 with ImageStackFrame

use of com.ibm.dtfj.image.ImageStackFrame in project openj9 by eclipse.

the class J9DDRImageThread method getStackFrames.

/* (non-Javadoc)
	 * @see com.ibm.dtfj.image.ImageThread#getStackFrames()
	 */
public Iterator<?> getStackFrames() throws DataUnavailable {
    List<? extends IOSStackFrame> frames = thread.getStackFrames();
    List<ImageStackFrame> dtfjFrames = new ArrayList<ImageStackFrame>(frames.size());
    for (IOSStackFrame thisFrame : frames) {
        dtfjFrames.add(new J9DDRImageStackFrame(process, thisFrame, this));
    }
    return dtfjFrames.iterator();
}
Also used : IOSStackFrame(com.ibm.j9ddr.corereaders.osthread.IOSStackFrame) ArrayList(java.util.ArrayList) ImageStackFrame(com.ibm.dtfj.image.ImageStackFrame)

Example 2 with ImageStackFrame

use of com.ibm.dtfj.image.ImageStackFrame in project openj9 by eclipse.

the class ImageStackFrameComparator method testEquals.

// getBasePointer()
// getProcedureAddress()
// getProcedureName()
public void testEquals(Object ddrObject, Object jextractObject, int members) {
    ImageStackFrame ddrImageStackFrame = (ImageStackFrame) ddrObject;
    ImageStackFrame jextractStackFrame = (ImageStackFrame) jextractObject;
    ImagePointerComparator imagePointerComparator = new ImagePointerComparator();
    // getBasePointer()
    if ((BASE_POINTER & members) != 0)
        imagePointerComparator.testComparatorEquals(ddrImageStackFrame, jextractStackFrame, "getBasePointer");
    // getProcedureAddress()
    if ((PROCEDURE_ADDRESS & members) != 0)
        imagePointerComparator.testComparatorEquals(ddrImageStackFrame, jextractStackFrame, "getProcedureAddress");
    // getProcedureName()
    if ((PROCEDURE_NAME & members) != 0)
        testJavaEquals(ddrImageStackFrame, jextractStackFrame, "getProcedureName");
}
Also used : ImageStackFrame(com.ibm.dtfj.image.ImageStackFrame)

Example 3 with ImageStackFrame

use of com.ibm.dtfj.image.ImageStackFrame in project openj9 by eclipse.

the class InfoThreadCommand method printStackFrameInfo.

private void printStackFrameInfo(ImageThread it) {
    Iterator itStackFrame;
    ImageStackFrame isf;
    try {
        itStackFrame = it.getStackFrames();
    } catch (DataUnavailable d) {
        out.print("   native stack frames: " + Exceptions.getDataUnavailableString() + "\n");
        return;
    }
    out.print("   native stack frames:");
    out.print("\n");
    while (itStackFrame.hasNext()) {
        Object o = itStackFrame.next();
        if (o instanceof CorruptData) {
            out.print("    <corrupt stack frame: " + ((CorruptData) o).toString() + ">\n");
            continue;
        }
        isf = (ImageStackFrame) o;
        out.print("    bp: ");
        try {
            out.print(toAdjustedHex(isf.getBasePointer().getAddress()));
        } catch (CorruptDataException e) {
            if (getArtifactType() == ArtifactType.javacore) {
                // javacore does not provide native stack base pointers, show as unavailable, not corrupt
                out.print(Exceptions.getDataUnavailableString());
            } else {
                out.print(Exceptions.getCorruptDataExceptionString());
            }
        }
        out.print(" pc: ");
        try {
            out.print(toAdjustedHex(isf.getProcedureAddress().getAddress()));
        } catch (CorruptDataException e) {
            out.print(Exceptions.getCorruptDataExceptionString());
        }
        out.print(" ");
        try {
            out.print(isf.getProcedureName());
        } catch (CorruptDataException e) {
            out.print(Exceptions.getCorruptDataExceptionString());
        }
        out.print("\n");
    }
}
Also used : Iterator(java.util.Iterator) DataUnavailable(com.ibm.dtfj.image.DataUnavailable) JavaObject(com.ibm.dtfj.java.JavaObject) CorruptData(com.ibm.dtfj.image.CorruptData) CorruptDataException(com.ibm.dtfj.image.CorruptDataException) ImageStackFrame(com.ibm.dtfj.image.ImageStackFrame)

Aggregations

ImageStackFrame (com.ibm.dtfj.image.ImageStackFrame)3 CorruptData (com.ibm.dtfj.image.CorruptData)1 CorruptDataException (com.ibm.dtfj.image.CorruptDataException)1 DataUnavailable (com.ibm.dtfj.image.DataUnavailable)1 JavaObject (com.ibm.dtfj.java.JavaObject)1 IOSStackFrame (com.ibm.j9ddr.corereaders.osthread.IOSStackFrame)1 ArrayList (java.util.ArrayList)1 Iterator (java.util.Iterator)1