Search in sources :

Example 1 with AddCorruptionToListListener

use of com.ibm.j9ddr.vm29.view.dtfj.java.corrupt.AddCorruptionToListListener in project openj9 by eclipse.

the class DTFJJavaRuntime method scanReferences.

private void scanReferences() {
    references = new LinkedList<Object>();
    AddCorruptionToListListener corruptionListener = new AddCorruptionToListListener(references);
    register(corruptionListener);
    try {
        RootScanner scanner = new DTFJRootScanner();
        /* We don't report stack slots here */
        scanner.setScanStackSlots(false);
        scanner.scanAllSlots();
    } catch (Throwable t) {
        CorruptData cd = J9DDRDTFJUtils.handleAsCorruptData(DTFJContext.getProcess(), t);
        references.add(cd);
    }
    unregister(corruptionListener);
}
Also used : RootScanner(com.ibm.j9ddr.vm29.j9.RootScanner) JavaObject(com.ibm.dtfj.java.JavaObject) CorruptData(com.ibm.dtfj.image.CorruptData) J9DDRCorruptData(com.ibm.j9ddr.view.dtfj.image.J9DDRCorruptData) AddCorruptionToListListener(com.ibm.j9ddr.vm29.view.dtfj.java.corrupt.AddCorruptionToListListener)

Example 2 with AddCorruptionToListListener

use of com.ibm.j9ddr.vm29.view.dtfj.java.corrupt.AddCorruptionToListListener in project openj9 by eclipse.

the class DTFJJavaRuntime method getJavaClassLoaders.

@SuppressWarnings("rawtypes")
public Iterator getJavaClassLoaders() {
    if (classLoaders != null) {
        // return cached set of class loaders
        return classLoaders.iterator();
    }
    classLoaders = new LinkedList<Object>();
    GCClassLoaderIterator classLoaderIterator;
    try {
        classLoaderIterator = GCClassLoaderIterator.from();
    } catch (Throwable t) {
        CorruptData cd = J9DDRDTFJUtils.handleAsCorruptData(DTFJContext.getProcess(), t);
        classLoaders.add(cd);
        return classLoaders.iterator();
    }
    AddCorruptionToListListener corruptionListener = new AddCorruptionToListListener(classLoaders);
    register(corruptionListener);
    try {
        while (!corruptionListener.fatalCorruption() && classLoaderIterator.hasNext()) {
            J9ClassLoaderPointer next = classLoaderIterator.next();
            if (next != null) {
                classLoaders.add(new DTFJJavaClassloader(next));
            }
        }
    } catch (Throwable t) {
        CorruptData cd = J9DDRDTFJUtils.handleAsCorruptData(DTFJContext.getProcess(), t);
        classLoaders.add(cd);
    }
    unregister(corruptionListener);
    return classLoaders.iterator();
}
Also used : GCClassLoaderIterator(com.ibm.j9ddr.vm29.j9.gc.GCClassLoaderIterator) J9ClassLoaderPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ClassLoaderPointer) JavaObject(com.ibm.dtfj.java.JavaObject) CorruptData(com.ibm.dtfj.image.CorruptData) J9DDRCorruptData(com.ibm.j9ddr.view.dtfj.image.J9DDRCorruptData) AddCorruptionToListListener(com.ibm.j9ddr.vm29.view.dtfj.java.corrupt.AddCorruptionToListListener)

Example 3 with AddCorruptionToListListener

use of com.ibm.j9ddr.vm29.view.dtfj.java.corrupt.AddCorruptionToListListener in project openj9 by eclipse.

the class DTFJJavaRuntime method getThreads.

@SuppressWarnings("rawtypes")
public Iterator getThreads() {
    GCVMThreadListIterator threadIterator;
    try {
        threadIterator = GCVMThreadListIterator.from();
    } catch (Throwable t) {
        CorruptData cd = J9DDRDTFJUtils.handleAsCorruptData(DTFJContext.getProcess(), t);
        return corruptIterator(cd);
    }
    List<Object> toIterate = new LinkedList<Object>();
    AddCorruptionToListListener listener = new AddCorruptionToListListener(toIterate);
    register(listener);
    try {
        while (threadIterator.hasNext() && !listener.fatalCorruption()) {
            J9VMThreadPointer next = threadIterator.next();
            if (next != null) {
                toIterate.add(new DTFJJavaThread(next));
            }
        }
    } catch (Throwable t) {
        CorruptData cd = J9DDRDTFJUtils.handleAsCorruptData(DTFJContext.getProcess(), t);
        toIterate.add(cd);
    }
    unregister(listener);
    return toIterate.iterator();
}
Also used : GCVMThreadListIterator(com.ibm.j9ddr.vm29.j9.gc.GCVMThreadListIterator) J9VMThreadPointer(com.ibm.j9ddr.vm29.pointer.generated.J9VMThreadPointer) CorruptData(com.ibm.dtfj.image.CorruptData) J9DDRCorruptData(com.ibm.j9ddr.view.dtfj.image.J9DDRCorruptData) JavaObject(com.ibm.dtfj.java.JavaObject) AddCorruptionToListListener(com.ibm.j9ddr.vm29.view.dtfj.java.corrupt.AddCorruptionToListListener) LinkedList(java.util.LinkedList)

Aggregations

CorruptData (com.ibm.dtfj.image.CorruptData)3 JavaObject (com.ibm.dtfj.java.JavaObject)3 J9DDRCorruptData (com.ibm.j9ddr.view.dtfj.image.J9DDRCorruptData)3 AddCorruptionToListListener (com.ibm.j9ddr.vm29.view.dtfj.java.corrupt.AddCorruptionToListListener)3 RootScanner (com.ibm.j9ddr.vm29.j9.RootScanner)1 GCClassLoaderIterator (com.ibm.j9ddr.vm29.j9.gc.GCClassLoaderIterator)1 GCVMThreadListIterator (com.ibm.j9ddr.vm29.j9.gc.GCVMThreadListIterator)1 J9ClassLoaderPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ClassLoaderPointer)1 J9VMThreadPointer (com.ibm.j9ddr.vm29.pointer.generated.J9VMThreadPointer)1 LinkedList (java.util.LinkedList)1