Search in sources :

Example 1 with AttLocalVariableTypeTable

use of com.android.dx.cf.attrib.AttLocalVariableTypeTable in project buck by facebook.

the class StdAttributeFactory method localVariableTypeTable.

/**
     * Parses a {@code LocalVariableTypeTable} attribute.
     */
private Attribute localVariableTypeTable(DirectClassFile cf, int offset, int length, ParseObserver observer) {
    if (length < 2) {
        return throwSeverelyTruncated();
    }
    ByteArray bytes = cf.getBytes();
    int count = bytes.getUnsignedShort(offset);
    if (observer != null) {
        observer.parsed(bytes, offset, 2, "local_variable_type_table_length: " + Hex.u2(count));
    }
    LocalVariableList list = parseLocalVariables(bytes.slice(offset + 2, offset + length), cf.getConstantPool(), observer, count, true);
    return new AttLocalVariableTypeTable(list);
}
Also used : LocalVariableList(com.android.dx.cf.code.LocalVariableList) AttLocalVariableTypeTable(com.android.dx.cf.attrib.AttLocalVariableTypeTable) ByteArray(com.android.dx.util.ByteArray)

Example 2 with AttLocalVariableTypeTable

use of com.android.dx.cf.attrib.AttLocalVariableTypeTable in project J2ME-Loader by nikita36078.

the class StdAttributeFactory method localVariableTypeTable.

/**
 * Parses a {@code LocalVariableTypeTable} attribute.
 */
private Attribute localVariableTypeTable(DirectClassFile cf, int offset, int length, ParseObserver observer) {
    if (length < 2) {
        return throwSeverelyTruncated();
    }
    ByteArray bytes = cf.getBytes();
    int count = bytes.getUnsignedShort(offset);
    if (observer != null) {
        observer.parsed(bytes, offset, 2, "local_variable_type_table_length: " + Hex.u2(count));
    }
    LocalVariableList list = parseLocalVariables(bytes.slice(offset + 2, offset + length), cf.getConstantPool(), observer, count, true);
    return new AttLocalVariableTypeTable(list);
}
Also used : LocalVariableList(com.android.dx.cf.code.LocalVariableList) AttLocalVariableTypeTable(com.android.dx.cf.attrib.AttLocalVariableTypeTable) ByteArray(com.android.dx.util.ByteArray)

Aggregations

AttLocalVariableTypeTable (com.android.dx.cf.attrib.AttLocalVariableTypeTable)2 LocalVariableList (com.android.dx.cf.code.LocalVariableList)2 ByteArray (com.android.dx.util.ByteArray)2