use of com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer in project openj9 by eclipse.
the class DumpAllRomClassLinearCommand method run.
public void run(String command, String[] args, Context context, PrintStream out) throws DDRInteractiveCommandException {
long nestingThreashold;
if (args.length > 1) {
throw new DDRInteractiveCommandException("This debug extension accepts none or one argument!");
} else if (args.length == 1) {
nestingThreashold = Long.valueOf(args[0]);
} else {
nestingThreashold = 1;
}
try {
J9JavaVMPointer vm = J9RASHelper.getVM(DataType.getJ9RASPointer());
if (null != vm) {
out.println();
out.println("!j9javavm " + vm.getHexAddress());
} else {
throw new DDRInteractiveCommandException("Unable to find the VM in core dump!");
}
out.println();
ROMClassesIterator iterator = new ROMClassesIterator(out, vm.classMemorySegments());
while (iterator.hasNext()) {
J9ROMClassPointer classPointer = iterator.next();
out.println("!dumpromclasslinear " + classPointer.getHexAddress());
// ROM Class 'org/apache/tomcat/util/buf/MessageBytes' at 0x0DCF9008:
out.println(String.format("ROM Class '%s' at %s", J9UTF8Helper.stringValue(classPointer.className()), classPointer.getHexAddress()));
out.println();
ClassWalker classWalker = new RomClassWalker(classPointer, context);
new LinearDumper().gatherLayoutInfo(out, classWalker, nestingThreashold);
out.println();
}
} catch (CorruptDataException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
use of com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer in project openj9 by eclipse.
the class FindOverlappingSegmentsCommand method run.
public void run(String command, String[] args, Context context, PrintStream out) throws DDRInteractiveCommandException {
int segmentType = MemorySegmentIterator.MEMORY_ALL_TYPES & ~((int) J9MemorySegment.MEMORY_TYPE_SHARED_META);
if (args.length == 0) {
/* use default */
} else {
String argument = args[0];
if (argument.equalsIgnoreCase("help")) {
printHelp(out);
return;
} else if (argument.equalsIgnoreCase("all")) {
segmentType = MemorySegmentIterator.MEMORY_ALL_TYPES;
} else if (argument.equalsIgnoreCase("virtual")) {
segmentType = (int) J9MemorySegment.MEMORY_TYPE_VIRTUAL;
}
}
try {
J9JavaVMPointer vm = J9RASHelper.getVM(DataType.getJ9RASPointer());
SegmentsUtil.checkSegmentsForOverlap(out, vm, segmentType);
out.append(nl);
} catch (CorruptDataException e) {
throw new DDRInteractiveCommandException(e);
}
}
use of com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer in project openj9 by eclipse.
the class FindVMCommand method run.
public void run(String command, String[] args, Context context, PrintStream out) throws DDRInteractiveCommandException {
try {
J9RASHelper.setCachedVM(null);
J9JavaVMPointer vm = J9RASHelper.getVM(DataType.getJ9RASPointer());
CommandUtils.dbgPrint(out, "!j9javavm %s\n", vm.getHexAddress());
} catch (CorruptDataException e) {
throw new DDRInteractiveCommandException(e);
}
}
use of com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer in project openj9 by eclipse.
the class GCCheckCommand method run.
public void run(String command, String[] args, Context context, PrintStream out) throws DDRInteractiveCommandException {
try {
J9JavaVMPointer vm = J9RASHelper.getVM(DataType.getJ9RASPointer());
GCCheckRunner.run(vm, args, out);
} catch (CorruptDataException e) {
throw new DDRInteractiveCommandException(e);
}
}
use of com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer in project openj9 by eclipse.
the class J9VTablesCommand method run.
public void run(String command, String[] args, Context context, final PrintStream out) throws DDRInteractiveCommandException {
try {
final J9JavaVMPointer vm = J9RASHelper.getVM(DataType.getJ9RASPointer());
J9ClassPointer ramClass;
UDATA vTableSlotCount;
// UDATA jitVTableSlotCount;
UDATAPointer jitVTable = UDATAPointer.NULL;
UDATAPointer vTable;
long address = CommandUtils.parsePointer(args[0], J9BuildFlags.env_data64);
ramClass = J9ClassPointer.cast(address);
vTable = J9ClassHelper.vTable(ramClass);
vTableSlotCount = vTable.at(0);
if (J9BuildFlags.interp_nativeSupport) {
if (!vm.jitConfig().isNull()) {
jitVTable = UDATAPointer.cast(U8Pointer.cast(ramClass).sub((vTableSlotCount.longValue() + 1) * UDATA.SIZEOF));
// jitVTableSlotCount = vTableSlotCount.sub(1);
}
}
CommandUtils.dbgPrint(out, String.format("VTable for j9class %s (size=%d - 1 for skipped resolve method)\n", ramClass.getHexAddress(), vTableSlotCount.longValue()));
CommandUtils.dbgPrint(out, String.format("\tInterpreted%s\n", (!jitVTable.isNull()) ? "\t\tJitted\n" : ""));
/* First entry in vtable is the vtable count.
* Second entry is the magic method reference.
* Skip both and start from the third element in vTable which is the first virtual method reference.
**/
for (long i = 2; i < vTableSlotCount.longValue() + 1; i++) {
String name = J9MethodHelper.getName(J9MethodPointer.cast(vTable.at(i)));
String intAddr = U8Pointer.cast(vTable.at(i)).getHexAddress();
if (!jitVTable.isNull()) {
String jitAddr = U8Pointer.cast(jitVTable.at(vTableSlotCount.sub(i))).getHexAddress();
CommandUtils.dbgPrint(out, String.format(" %d\t!j9method %s\t%s\t%s\n", i - 1, intAddr, jitAddr, name));
} else {
CommandUtils.dbgPrint(out, String.format(" %d\t!j9method %s\t%s\t\n", i - 1, intAddr, name));
}
}
return;
} catch (CorruptDataException e) {
throw new DDRInteractiveCommandException(e);
}
}
Aggregations