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;
}
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;
}
Aggregations