use of com.ibm.j9ddr.vm29.pointer.VoidPointer in project openj9 by eclipse.
the class CheckJNIWeakGlobalReferences method check.
@Override
public void check() {
try {
VoidPointer weakRefs = VoidPointer.cast(getJavaVM().jniWeakGlobalReferences());
GCJNIWeakGlobalReferenceIterator jniWeakGlobalReferenceIterator = GCJNIWeakGlobalReferenceIterator.from();
while (jniWeakGlobalReferenceIterator.hasNext()) {
PointerPointer slot = PointerPointer.cast(jniWeakGlobalReferenceIterator.nextAddress());
if (slot.notNull()) {
if (_engine.checkSlotPool(slot, weakRefs) != J9MODRON_SLOT_ITERATOR_OK) {
return;
}
}
}
} catch (CorruptDataException e) {
// TODO: handle exception
}
}
use of com.ibm.j9ddr.vm29.pointer.VoidPointer in project openj9 by eclipse.
the class CheckJVMTIObjectTagTables method check.
@Override
public void check() {
try {
J9JVMTIDataPointer jvmtiData = J9JVMTIDataPointer.cast(getJavaVM().jvmtiData());
if (jvmtiData.notNull()) {
GCJVMTIObjectTagTableListIterator objectTagTableList = GCJVMTIObjectTagTableListIterator.fromJ9JVMTIData(jvmtiData);
while (objectTagTableList.hasNext()) {
J9JVMTIEnvPointer list = objectTagTableList.next();
VoidPointer objectTagTable = VoidPointer.cast(list.objectTagTable());
GCJVMTIObjectTagTableIterator objectTagTableIterator = GCJVMTIObjectTagTableIterator.fromJ9JVMTIEnv(list);
while (objectTagTableIterator.hasNext()) {
PointerPointer slot = PointerPointer.cast(objectTagTableIterator.nextAddress());
if (slot.notNull()) {
if (_engine.checkSlotPool(slot, objectTagTable) != J9MODRON_SLOT_ITERATOR_OK) {
return;
}
}
}
}
}
} catch (CorruptDataException e) {
// TODO: handle exception
}
}
use of com.ibm.j9ddr.vm29.pointer.VoidPointer in project openj9 by eclipse.
the class CheckEngine method checkSlotPool.
public int checkSlotPool(PointerPointer objectIndirect, VoidPointer objectIndirectBase) {
J9ObjectPointer object;
try {
object = J9ObjectPointer.cast(objectIndirect.at(0));
int result = checkObjectIndirect(object);
if (J9MODRON_GCCHK_RC_OK != result) {
CheckError error = new CheckError(objectIndirectBase, objectIndirect, _cycle, _currentCheck, result, _cycle.nextErrorCount(), CheckError.check_type_other);
_reporter.report(error);
}
} catch (CorruptDataException e) {
// TODO : cde should be part of the error
CheckError error = new CheckError(objectIndirectBase, objectIndirect, _cycle, _currentCheck, J9MODRON_GCCHK_RC_CORRUPT_DATA_EXCEPTION, _cycle.nextErrorCount(), CheckError.check_type_other);
_reporter.report(error);
}
return J9MODRON_SLOT_ITERATOR_OK;
}
use of com.ibm.j9ddr.vm29.pointer.VoidPointer in project openj9 by eclipse.
the class CheckReporterTTY method report.
@Override
public void report(CheckError error) {
if (!shouldReport(error)) {
return;
}
try {
/* If slot is NULL, we are not scanning the slots of an object, but looking directly at an object/class on the heap. */
if ((error._slot != null) && (error._slot.notNull())) {
VoidPointer slot = error._slot;
UDATA slotValue;
switch(error._objectType) {
case check_type_object:
J9ObjectPointer fieldValue = ObjectReferencePointer.cast(slot).at(0);
slotValue = UDATA.cast(fieldValue);
break;
case check_type_thread:
slotValue = UDATAPointer.cast(slot).at(0);
slot = error._stackLocation;
break;
case check_type_unfinalized:
// In this case, there isn't really a "slot", only the value
// TODO kmt : This probably shouldn't use the object(offset) format.
slotValue = UDATA.cast(slot);
slot = VoidPointer.NULL;
break;
default:
slotValue = UDATAPointer.cast(slot).at(0);
}
out.println(String.format(" <gc check (%d): %s: %s: %sslot %x(%x) -> %x: %s>", error._errorNumber, "from debugger", error._check.getCheckName(), error._elementName, error._object.getAddress(), slot.getAddress(), slotValue.longValue(), getErrorType(error._errorCode)));
} else {
out.println(String.format(" <gc check (%d): %s: %s: %s%x: %s>", error._errorNumber, "from debugger", error._check.getCheckName(), error._elementName, error._object.getAddress(), getErrorType(error._errorCode)));
/* If the basic checks have been made (alignment, etc.) display header info. */
if (error._objectType == check_type_object) {
reportObjectHeader(error, J9ObjectPointer.cast(error._object), "");
}
}
} catch (CorruptDataException cde) {
out.println(String.format(" <gc check (%d): %s: %s: %s%x: %s>", error._errorNumber, "from debugger", error._check.getCheckName(), error._elementName, error._object.getAddress(), getErrorType(error._errorCode)));
}
}
use of com.ibm.j9ddr.vm29.pointer.VoidPointer in project openj9 by eclipse.
the class J9SRPFormatter method format.
@Override
public FormatWalkResult format(String name, String type, String declaredType, int thisTypeCode, long address, PrintStream out, Context context, IStructureFormatter structureFormatter) throws CorruptDataException {
if (thisTypeCode != typeCode) {
return FormatWalkResult.KEEP_WALKING;
}
VoidPointer targetAddress = VoidPointer.NULL;
/* Figure out the resulting address */
if (wide) {
WideSelfRelativePointer s = WideSelfRelativePointer.cast(address);
targetAddress = s.get();
} else {
SelfRelativePointer s = SelfRelativePointer.cast(address);
targetAddress = s.get();
}
if (type.contains("(")) {
/* Strip off one layer of SRP, work out the SRP address, and re-format it */
type = stripSRP(type);
structureFormatter.formatField(name, type, type, targetAddress.getAddress(), out, context);
} else {
/* An SRP without the final type specified */
out.print("!j9x ");
out.print(targetAddress.getHexAddress());
}
return FormatWalkResult.STOP_WALKING;
}
Aggregations