Search in sources :

Example 31 with Pointer

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

the class CheckEngine method regionForAddress.

// TODO kmt : this doesn't belong here
private GCHeapRegionDescriptor regionForAddress(AbstractPointer pointer) {
    try {
        if (null == _hrm) {
            MM_HeapRegionManagerPointer hrm = MM_GCExtensionsPointer.cast(_javaVM.gcExtensions()).heapRegionManager();
            _hrm = GCHeapRegionManager.fromHeapRegionManager(hrm);
        }
        return _hrm.regionDescriptorForAddress(pointer);
    } catch (CorruptDataException cde) {
    }
    return null;
}
Also used : MM_HeapRegionManagerPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_HeapRegionManagerPointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException)

Example 32 with Pointer

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

the class DTFJJavaRuntime method getHeapFromAddress.

/* 
	 * Returns the JavaHeap which contains the passed-in address
	 * Returns null if no containing JavaHeap is found
	 */
@SuppressWarnings("rawtypes")
public DTFJJavaHeap getHeapFromAddress(ImagePointer address) {
    try {
        VoidPointer pointer = VoidPointer.cast(address.getAddress());
        Iterator heapsIterator = getHeaps();
        while (heapsIterator.hasNext()) {
            DTFJJavaHeap heap = (DTFJJavaHeap) heapsIterator.next();
            Iterator sectionsIterator = heap.getSections();
            while (sectionsIterator.hasNext()) {
                ImageSection section = (ImageSection) sectionsIterator.next();
                VoidPointer base = VoidPointer.cast(section.getBaseAddress().getAddress());
                VoidPointer top = base.addOffset(section.getSize());
                if (pointer.gte(base) && pointer.lt(top)) {
                    // Object is within this section
                    return heap;
                }
            }
        }
    } catch (Throwable t) {
        // just log exceptions and allow it to fall through
        J9DDRDTFJUtils.handleAsCorruptDataException(DTFJContext.getProcess(), t);
    }
    return null;
}
Also used : VoidPointer(com.ibm.j9ddr.vm29.pointer.VoidPointer) GCClassLoaderIterator(com.ibm.j9ddr.vm29.j9.gc.GCClassLoaderIterator) GCVMThreadListIterator(com.ibm.j9ddr.vm29.j9.gc.GCVMThreadListIterator) MemoryCategoryIterator(com.ibm.j9ddr.vm29.j9.walkers.MemoryCategoryIterator) J9DDRDTFJUtils.corruptIterator(com.ibm.j9ddr.view.dtfj.J9DDRDTFJUtils.corruptIterator) J9MemTagIterator(com.ibm.j9ddr.vm29.j9.walkers.J9MemTagIterator) Iterator(java.util.Iterator) DTFJMonitorIterator(com.ibm.j9ddr.vm29.view.dtfj.java.j9.DTFJMonitorIterator) ImageSection(com.ibm.dtfj.image.ImageSection) J9DDRImageSection(com.ibm.j9ddr.view.dtfj.image.J9DDRImageSection)

Aggregations

CorruptDataException (com.ibm.j9ddr.CorruptDataException)14 UDATA (com.ibm.j9ddr.vm29.types.UDATA)14 J9JavaVMPointer (com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer)6 VoidPointer (com.ibm.j9ddr.vm29.pointer.VoidPointer)5 PointerPointer (com.ibm.j9ddr.vm29.pointer.PointerPointer)4 J9ObjectPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer)4 GCHeapRegionDescriptor (com.ibm.j9ddr.vm29.j9.gc.GCHeapRegionDescriptor)3 AbstractPointer (com.ibm.j9ddr.vm29.pointer.AbstractPointer)3 J9ROMClassPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ROMClassPointer)3 ImageSection (com.ibm.dtfj.image.ImageSection)2 FieldDescriptor (com.ibm.j9ddr.StructureReader.FieldDescriptor)2 StructureDescriptor (com.ibm.j9ddr.StructureReader.StructureDescriptor)2 DDRInteractiveCommandException (com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException)2 J9DDRImageSection (com.ibm.j9ddr.view.dtfj.image.J9DDRImageSection)2 GCClassLoaderIterator (com.ibm.j9ddr.vm29.j9.gc.GCClassLoaderIterator)2 GCHeapRegionIterator (com.ibm.j9ddr.vm29.j9.gc.GCHeapRegionIterator)2 GCScavengerForwardedHeader (com.ibm.j9ddr.vm29.j9.gc.GCScavengerForwardedHeader)2 GCVMThreadListIterator (com.ibm.j9ddr.vm29.j9.gc.GCVMThreadListIterator)2 U32Pointer (com.ibm.j9ddr.vm29.pointer.U32Pointer)2 UDATAPointer (com.ibm.j9ddr.vm29.pointer.UDATAPointer)2