Class LocalVariableTableWriter
java.lang.Object
com.ibm.wala.shrike.shrikeCT.ClassWriter.Element
com.ibm.wala.shrike.shrikeCT.LocalVariableTableWriter
This class helps emit LocalVariableTable attributes.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcopyInto(byte[] buf, int offset) Copy the bytes into 'buf' at offset 'offset'.intgetSize()static int[]makeRawTable(int[][] varMap, Compiler.Output output) Build a raw local variable table from a formatted variable map.voidsetRawTable(int[] table) Set the raw local variable table values.
-
Constructor Details
-
LocalVariableTableWriter
Create a blank LocalVariableTable.- Throws:
IllegalArgumentException- if w is null
-
-
Method Details
-
setRawTable
public void setRawTable(int[] table) Set the raw local variable table values. Consider using LocalVariableTableWriter.makeRawTable to build the raw values.- Parameters:
table- the raw values, a flattened sequence of (startPC, length, nameIndex, typeIndex, var) tuples
-
getSize
public int getSize()- Specified by:
getSizein classClassWriter.Element- Returns:
- the number of bytes that will be generated.
-
copyInto
Description copied from class:ClassWriter.ElementCopy the bytes into 'buf' at offset 'offset'.- Specified by:
copyIntoin classClassWriter.Element- Returns:
- the number of bytes copies, which must be equal to getSize()
- Throws:
IllegalArgumentException
-
makeRawTable
public static int[] makeRawTable(int[][] varMap, Compiler.Output output) throws IllegalArgumentException Build a raw local variable table from a formatted variable map.- Parameters:
varMap- an array mapping bytecode offsets to a variable map for each offset; a variable map is a array of 2*localVars elements, containing a (nameIndex, typeIndex) for each local variable; the pair (0,0) indicates that there is no information about that local variable at that offset- Throws:
IllegalArgumentException- if varMap == null
-