use of com.ibm.j9ddr.vm29.pointer.generated.J9DbgROMClassBuilderPointer in project openj9 by eclipse.
the class VmCheckCommand method checkLocalInternTableSanity.
/*
* Based on vmchk/checkinterntable.c r1.3
*
* J9LocalInternTableSanity sanity:
* if J9JavaVM->dynamicLoadBuffers != NULL
* invariantInternTree check:
* For each J9InternHashTableEntry
* Ensure J9InternHashTableEntry->utf8 is valid
* Ensure J9InternHashTableEntry->classLoader is valid
*/
private void checkLocalInternTableSanity(J9JavaVMPointer vm, PrintStream out) throws CorruptDataException {
int count = 0;
reportMessage(out, "Checking ROM intern string nodes");
J9TranslationBufferSetPointer dynamicLoadBuffers = vm.dynamicLoadBuffers();
if (!dynamicLoadBuffers.isNull()) {
J9DbgROMClassBuilderPointer romClassBuilder = J9DbgROMClassBuilderPointer.cast(dynamicLoadBuffers.romClassBuilder());
J9DbgStringInternTablePointer stringInternTable = romClassBuilder.stringInternTable();
J9InternHashTableEntryPointer node = stringInternTable.headNode();
while (!node.isNull()) {
J9UTF8Pointer utf8 = node.utf8();
J9ClassLoaderPointer classLoader = node.classLoader();
if (!verifyUTF8(utf8)) {
reportError(out, "invalid utf8=0x%s for node=0x%s", Long.toHexString(utf8.getAddress()), Long.toHexString(node.getAddress()));
}
if (!verifyJ9ClassLoader(vm, classLoader)) {
reportError(out, "invalid classLoader=0x%s for node=0x%s", Long.toHexString(classLoader.getAddress()), Long.toHexString(node.getAddress()));
}
count++;
node = node.nextNode();
}
}
reportMessage(out, "Checking %d ROM intern string nodes done", count);
}
use of com.ibm.j9ddr.vm29.pointer.generated.J9DbgROMClassBuilderPointer in project openj9 by eclipse.
the class WalkInternTableCommand method getRomClassBuilderPtr.
/**
* This method is used to get the pointer to the RomClassBuilder
* @param out PrintStream
* @return void
* @throws CorruptDataException
*/
private J9DbgStringInternTablePointer getRomClassBuilderPtr(PrintStream out) throws CorruptDataException {
try {
J9JavaVMPointer vm = J9RASHelper.getVM(DataType.getJ9RASPointer());
if (vm.isNull()) {
out.append("VM can not be found " + nl);
return null;
}
J9TranslationBufferSetPointer translationBufferSetPtr = vm.dynamicLoadBuffers();
if (translationBufferSetPtr.isNull()) {
out.append("J9TranslationBufferSet can not be found " + nl);
return null;
}
J9DbgROMClassBuilderPointer romClassBuilderPtr = J9DbgROMClassBuilderPointer.cast(translationBufferSetPtr.romClassBuilder());
if (romClassBuilderPtr.isNull()) {
out.append("romClassBuilderPtr can not be found " + nl);
return null;
}
return romClassBuilderPtr.stringInternTable();
} catch (CorruptDataException e) {
throw e;
}
}
Aggregations