public static IVariableElement fromDebugSegment(String name, Set<AccessType> accessType, byte[] segment, int currentPos, int textAreaOffset, ByteOrder order) { int dataType = ByteBuffer.wrap(segment, currentPos, Short.BYTES).order(order).getShort(); int extent = ByteBuffer.wrap(segment, currentPos + 4, Short.BYTES).order(order).getShort(); int flags = ByteBuffer.wrap(segment, currentPos + 6, Short.BYTES).order(order).getShort(); int nameOffset = ByteBuffer.wrap(segment, currentPos + 12, Integer.BYTES).order(order).getInt(); String name2 = nameOffset == 0 ? name : RCodeInfo.readNullTerminatedString(segment, textAreaOffset + nameOffset); int typeNameOffset = ByteBuffer.wrap(segment, currentPos + 16, Integer.BYTES).order(order).getInt(); String typeName = typeNameOffset == 0 ? "" : RCodeInfo.readNullTerminatedString(segment, textAreaOffset + typeNameOffset); return new VariableElementV11(name2, accessType, dataType, extent, flags, typeName); }
public static IVariableElement fromDebugSegment(String name, Set<AccessType> accessType, byte[] segment, int currentPos, int textAreaOffset, ByteOrder order) { int dataType = ByteBuffer.wrap(segment, currentPos, Short.BYTES).order(order).getShort(); int extent = ByteBuffer.wrap(segment, currentPos + 4, Short.BYTES).order(order).getShort(); int flags = ByteBuffer.wrap(segment, currentPos + 6, Short.BYTES).order(order).getShort(); int nameOffset = ByteBuffer.wrap(segment, currentPos + 12, Integer.BYTES).order(order).getInt(); String name2 = nameOffset == 0 ? name : RCodeInfo.readNullTerminatedString(segment, textAreaOffset + nameOffset); int typeNameOffset = ByteBuffer.wrap(segment, currentPos + 16, Integer.BYTES).order(order).getInt(); String typeName = typeNameOffset == 0 ? "" : RCodeInfo.readNullTerminatedString(segment, textAreaOffset + typeNameOffset); return new VariableElementV11(name2, accessType, dataType, extent, flags, typeName); }