Search in sources :

Example 1 with MM_MemorySpacePointer

use of com.ibm.j9ddr.vm29.pointer.generated.MM_MemorySpacePointer in project openj9 by eclipse.

the class DTFJJavaRuntime method getHeaps.

@SuppressWarnings("rawtypes")
public Iterator getHeaps() throws UnsupportedOperationException {
    try {
        LinkedList<Object> heaps = new LinkedList<Object>();
        VoidPointer memorySpace = DTFJContext.getVm().defaultMemorySpace();
        MM_MemorySpacePointer defaultMemorySpace = MM_MemorySpacePointer.cast(memorySpace);
        U8Pointer namePtr = defaultMemorySpace._name();
        // MEMORY_SPACE_NAME_UNDEFINED
        String name = "No name";
        if (namePtr != null && namePtr != U8Pointer.NULL) {
            try {
                name = namePtr.getCStringAtOffset(0);
            } catch (com.ibm.j9ddr.CorruptDataException e) {
                name = "<<corrupt heap name>>";
            }
        }
        heaps.add(new DTFJJavaHeap(defaultMemorySpace, name, DTFJContext.getImagePointer(memorySpace.getAddress())));
        return heaps.iterator();
    } catch (Throwable t) {
        CorruptData cd = J9DDRDTFJUtils.handleAsCorruptData(DTFJContext.getProcess(), t);
        return corruptIterator(cd);
    }
}
Also used : VoidPointer(com.ibm.j9ddr.vm29.pointer.VoidPointer) MM_MemorySpacePointer(com.ibm.j9ddr.vm29.pointer.generated.MM_MemorySpacePointer) U8Pointer(com.ibm.j9ddr.vm29.pointer.U8Pointer) LinkedList(java.util.LinkedList) JavaObject(com.ibm.dtfj.java.JavaObject) CorruptData(com.ibm.dtfj.image.CorruptData) J9DDRCorruptData(com.ibm.j9ddr.view.dtfj.image.J9DDRCorruptData)

Aggregations

CorruptData (com.ibm.dtfj.image.CorruptData)1 JavaObject (com.ibm.dtfj.java.JavaObject)1 J9DDRCorruptData (com.ibm.j9ddr.view.dtfj.image.J9DDRCorruptData)1 U8Pointer (com.ibm.j9ddr.vm29.pointer.U8Pointer)1 VoidPointer (com.ibm.j9ddr.vm29.pointer.VoidPointer)1 MM_MemorySpacePointer (com.ibm.j9ddr.vm29.pointer.generated.MM_MemorySpacePointer)1 LinkedList (java.util.LinkedList)1