Search in sources :

Example 21 with J9JavaVMPointer

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();
    }
}
Also used : ROMClassesIterator(com.ibm.j9ddr.vm29.j9.walkers.ROMClassesIterator) J9ROMClassPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ROMClassPointer) DDRInteractiveCommandException(com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException) LinearDumper(com.ibm.j9ddr.vm29.tools.ddrinteractive.LinearDumper) J9JavaVMPointer(com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer) ClassWalker(com.ibm.j9ddr.vm29.tools.ddrinteractive.ClassWalker) RomClassWalker(com.ibm.j9ddr.vm29.tools.ddrinteractive.RomClassWalker) RomClassWalker(com.ibm.j9ddr.vm29.tools.ddrinteractive.RomClassWalker) CorruptDataException(com.ibm.j9ddr.CorruptDataException)

Example 22 with J9JavaVMPointer

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);
    }
}
Also used : DDRInteractiveCommandException(com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException) J9JavaVMPointer(com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException)

Example 23 with J9JavaVMPointer

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);
    }
}
Also used : DDRInteractiveCommandException(com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException) J9JavaVMPointer(com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException)

Example 24 with J9JavaVMPointer

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);
    }
}
Also used : DDRInteractiveCommandException(com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException) J9JavaVMPointer(com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException)

Example 25 with J9JavaVMPointer

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);
    }
}
Also used : UDATA(com.ibm.j9ddr.vm29.types.UDATA) J9ClassPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer) UDATAPointer(com.ibm.j9ddr.vm29.pointer.UDATAPointer) DDRInteractiveCommandException(com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException) J9JavaVMPointer(com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException)

Aggregations

J9JavaVMPointer (com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer)57 CorruptDataException (com.ibm.j9ddr.CorruptDataException)49 DDRInteractiveCommandException (com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException)39 J9ClassPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer)23 J9VMThreadPointer (com.ibm.j9ddr.vm29.pointer.generated.J9VMThreadPointer)17 UDATA (com.ibm.j9ddr.vm29.types.UDATA)13 J9ROMClassPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ROMClassPointer)10 ClassSegmentIterator (com.ibm.j9ddr.vm29.j9.walkers.ClassSegmentIterator)8 J9ObjectPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer)8 J9MemorySegmentPointer (com.ibm.j9ddr.vm29.pointer.generated.J9MemorySegmentPointer)6 PatternString (com.ibm.j9ddr.util.PatternString)5 MonitorIterator (com.ibm.j9ddr.vm29.j9.walkers.MonitorIterator)5 ROMClassesIterator (com.ibm.j9ddr.vm29.j9.walkers.ROMClassesIterator)5 U8Pointer (com.ibm.j9ddr.vm29.pointer.U8Pointer)5 J9ClassLoaderPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ClassLoaderPointer)5 MM_HeapRegionManagerPointer (com.ibm.j9ddr.vm29.pointer.generated.MM_HeapRegionManagerPointer)5 Table (com.ibm.j9ddr.tools.ddrinteractive.Table)4 GCHeapRegionDescriptor (com.ibm.j9ddr.vm29.j9.gc.GCHeapRegionDescriptor)4 J9MethodPointer (com.ibm.j9ddr.vm29.pointer.generated.J9MethodPointer)4 J9ThreadMonitorPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ThreadMonitorPointer)4