Search in sources :

Example 1 with WideSelfRelativePointer

use of com.ibm.j9ddr.vm29.pointer.WideSelfRelativePointer 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;
}
Also used : VoidPointer(com.ibm.j9ddr.vm29.pointer.VoidPointer) WideSelfRelativePointer(com.ibm.j9ddr.vm29.pointer.WideSelfRelativePointer) SelfRelativePointer(com.ibm.j9ddr.vm29.pointer.SelfRelativePointer) WideSelfRelativePointer(com.ibm.j9ddr.vm29.pointer.WideSelfRelativePointer)

Aggregations

SelfRelativePointer (com.ibm.j9ddr.vm29.pointer.SelfRelativePointer)1 VoidPointer (com.ibm.j9ddr.vm29.pointer.VoidPointer)1 WideSelfRelativePointer (com.ibm.j9ddr.vm29.pointer.WideSelfRelativePointer)1