Class LocalVariableTableReader
java.lang.Object
com.ibm.wala.shrike.shrikeCT.AttributeReader
com.ibm.wala.shrike.shrikeCT.LocalVariableTableReader
This class reads LocalVariableTable attributes.
Instead of constructing a LocalVariableTable directly, consider just calling LocalVariableTable.makeVarMap for convenient access to aggregate local variable data from all the LocalVariableTable attributes for a given Code.
-
Field Summary
Fields inherited from class AttributeReader
attr, cr, lengthModifier and TypeFieldDescriptionprotected final intprotected final ClassReaderprotected final int -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class AttributeReader
checkSize, checkSizeEquals, getClassReader, getRawOffset, getRawSizeModifier and TypeMethodDescriptionprotected final voidcheckSize(int offset, int len) Ensure that the len bytes starting at offset fall within the attribute data.protected final voidcheckSizeEquals(int offset, int len) Ensure that the len bytes starting at offset end at the end of the attribute data.final ClassReaderfinal intfinal int
-
Constructor Details
-
LocalVariableTableReader
- Throws:
InvalidClassFileException
-
-
Method Details
-
getRawTable
public int[] getRawTable()- Returns:
- the raw line number table data, a flattened sequence of (startPC, PClength, nameIndex, typeIndex, var) tuples
-
makeVarMap
public static int[][] makeVarMap(CodeReader code) throws InvalidClassFileException, IllegalArgumentException - Returns:
- an array mapping bytecode offsets to arrays representing the local variable maps for each offset; a local variable map is represented as an array of localVars*2 elements, containing a pair (nameIndex, typeIndex) for each local variable; a pair (0,0) indicates there is no information for that local variable at that offset
- Throws:
InvalidClassFileExceptionIllegalArgumentException
-