Search in sources :

Example 6 with LocalVariableList

use of com.android.dx.cf.code.LocalVariableList in project J2ME-Loader by nikita36078.

the class StdAttributeFactory method localVariableTable.

/**
 * Parses a {@code LocalVariableTable} attribute.
 */
private Attribute localVariableTable(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_table_length: " + Hex.u2(count));
    }
    LocalVariableList list = parseLocalVariables(bytes.slice(offset + 2, offset + length), cf.getConstantPool(), observer, count, false);
    return new AttLocalVariableTable(list);
}
Also used : LocalVariableList(com.android.dx.cf.code.LocalVariableList) ByteArray(com.android.dx.util.ByteArray) AttLocalVariableTable(com.android.dx.cf.attrib.AttLocalVariableTable)

Aggregations

LocalVariableList (com.android.dx.cf.code.LocalVariableList)6 ByteArray (com.android.dx.util.ByteArray)6 AttLocalVariableTable (com.android.dx.cf.attrib.AttLocalVariableTable)2 AttLocalVariableTypeTable (com.android.dx.cf.attrib.AttLocalVariableTypeTable)2 CstString (com.android.dx.rop.cst.CstString)2 IOException (java.io.IOException)2