Search in sources :

Example 91 with UDATA

use of com.ibm.j9ddr.vm29.types.UDATA 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)));
    }
}
Also used : UDATA(com.ibm.j9ddr.vm29.types.UDATA) VoidPointer(com.ibm.j9ddr.vm29.pointer.VoidPointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException) J9ObjectPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer)

Example 92 with UDATA

use of com.ibm.j9ddr.vm29.types.UDATA in project openj9 by eclipse.

the class J9ObjectStructureFormatter method printJ9ObjectFields.

private void printJ9ObjectFields(PrintStream out, int tabLevel, J9ClassPointer localClazz, U8Pointer dataStart, J9ObjectPointer localObject) throws CorruptDataException {
    J9ClassPointer instanceClass = localClazz;
    long superclassIndex;
    long depth;
    J9ClassPointer previousSuperclass = J9ClassPointer.NULL;
    boolean lockwordPrinted = false;
    if (J9BuildFlags.thr_lockNursery) {
        lockwordPrinted = false;
    }
    /* print individual fields */
    J9UTF8Pointer classNameUTF = instanceClass.romClass().className();
    padding(out, tabLevel);
    out.println(String.format("struct J9Class* clazz = !j9class 0x%X   // %s", localClazz.getAddress(), J9UTF8Helper.stringValue(classNameUTF)));
    padding(out, tabLevel);
    out.println(String.format("Object flags = %s;", J9ObjectHelper.flags(localObject).getHexValue()));
    if (!J9BuildFlags.thr_lockNursery) {
        UDATA lockword = J9ObjectHelper.monitor(localObject);
        if (lockword != null) {
            padding(out, tabLevel);
            out.println(String.format("j9objectmonitor_t monitor = %s;", lockword.getHexValue()));
        }
    }
    depth = J9ClassHelper.classDepth(instanceClass).longValue();
    for (superclassIndex = 0; superclassIndex <= depth; superclassIndex++) {
        J9ClassPointer superclass;
        if (superclassIndex == depth) {
            superclass = instanceClass;
        } else {
            superclass = J9ClassPointer.cast(instanceClass.superclasses().at(superclassIndex));
        }
        U32 flags = new U32(J9VM_FIELD_OFFSET_WALK_INCLUDE_INSTANCE | J9VM_FIELD_OFFSET_WALK_INCLUDE_HIDDEN);
        Iterator<J9ObjectFieldOffset> iterator = J9ObjectFieldOffsetIterator.J9ObjectFieldOffsetIteratorFor(superclass.romClass(), instanceClass, previousSuperclass, flags);
        while (iterator.hasNext()) {
            J9ObjectFieldOffset result = iterator.next();
            boolean printField = true;
            boolean isHiddenField = result.isHidden();
            if (J9BuildFlags.thr_lockNursery) {
                boolean isLockword = (isHiddenField && ((result.getOffsetOrAddress().add(J9Object.SIZEOF).eq(superclass.lockOffset()))));
                if (isLockword) {
                    /* Print the lockword field if it is indeed the lockword for this instanceClass and we haven't printed it yet. */
                    printField = (!lockwordPrinted && (instanceClass.lockOffset().eq(superclass.lockOffset())));
                    if (printField) {
                        lockwordPrinted = true;
                    }
                }
            }
            if (printField) {
                printObjectField(out, tabLevel, localClazz, dataStart, superclass, result);
                out.println();
            }
        }
        previousSuperclass = superclass;
    }
}
Also used : UDATA(com.ibm.j9ddr.vm29.types.UDATA) U32(com.ibm.j9ddr.vm29.types.U32) J9ClassPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer) J9ObjectFieldOffset(com.ibm.j9ddr.vm29.j9.J9ObjectFieldOffset) J9UTF8Pointer(com.ibm.j9ddr.vm29.pointer.generated.J9UTF8Pointer)

Example 93 with UDATA

use of com.ibm.j9ddr.vm29.types.UDATA in project openj9 by eclipse.

the class DTFJContext method cacheJITMethodAddresses.

private static void cacheJITMethodAddresses() {
    jitMethodCache = new HashMap<J9MethodPointer, List<J9JITExceptionTablePointer>>();
    try {
        J9MemorySegmentListPointer dataCacheList = getVm().jitConfig().dataCacheList();
        J9MemorySegmentPointer dataCache = dataCacheList.nextSegment();
        while (dataCache.notNull()) {
            UDATA current = UDATA.cast(dataCache.heapBase());
            UDATA end = UDATA.cast(dataCache.heapAlloc());
            while (current.lt(end)) {
                J9JITDataCacheHeaderPointer hdr = J9JITDataCacheHeaderPointer.cast(current);
                if (hdr.type().longValue() == J9DataTypeExceptionInfo) {
                    J9JITExceptionTablePointer metaData = J9JITExceptionTablePointer.cast(current.add(J9JITDataCacheHeader.SIZEOF));
                    addMetaData(metaData);
                }
                current = current.add(hdr.size());
            }
            dataCache = dataCache.nextSegment();
        }
    } catch (CorruptDataException e) {
        return;
    }
}
Also used : UDATA(com.ibm.j9ddr.vm29.types.UDATA) J9JITDataCacheHeaderPointer(com.ibm.j9ddr.vm29.pointer.generated.J9JITDataCacheHeaderPointer) J9MethodPointer(com.ibm.j9ddr.vm29.pointer.generated.J9MethodPointer) J9MemorySegmentListPointer(com.ibm.j9ddr.vm29.pointer.generated.J9MemorySegmentListPointer) J9JITExceptionTablePointer(com.ibm.j9ddr.vm29.pointer.generated.J9JITExceptionTablePointer) ArrayList(java.util.ArrayList) List(java.util.List) J9MemorySegmentPointer(com.ibm.j9ddr.vm29.pointer.generated.J9MemorySegmentPointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException)

Aggregations

UDATA (com.ibm.j9ddr.vm29.types.UDATA)86 CorruptDataException (com.ibm.j9ddr.CorruptDataException)22 U32 (com.ibm.j9ddr.vm29.types.U32)16 J9ObjectPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer)14 U8Pointer (com.ibm.j9ddr.vm29.pointer.U8Pointer)10 J9JavaVMPointer (com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer)10 UDATAPointer (com.ibm.j9ddr.vm29.pointer.UDATAPointer)9 DDRInteractiveCommandException (com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException)8 J9ClassPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer)8 VoidPointer (com.ibm.j9ddr.vm29.pointer.VoidPointer)7 J9VMThreadPointer (com.ibm.j9ddr.vm29.pointer.generated.J9VMThreadPointer)6 PointerPointer (com.ibm.j9ddr.vm29.pointer.PointerPointer)5 J9ROMMethodPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ROMMethodPointer)4 U16 (com.ibm.j9ddr.vm29.types.U16)4 J9ObjectFieldOffset (com.ibm.j9ddr.vm29.j9.J9ObjectFieldOffset)3 GCHeapRegionDescriptor (com.ibm.j9ddr.vm29.j9.gc.GCHeapRegionDescriptor)3 J9ArrayClassPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ArrayClassPointer)3 J9JITExceptionTablePointer (com.ibm.j9ddr.vm29.pointer.generated.J9JITExceptionTablePointer)3 J9MethodPointer (com.ibm.j9ddr.vm29.pointer.generated.J9MethodPointer)3 IDATA (com.ibm.j9ddr.vm29.types.IDATA)3