Class LocalVariableTableWriter

java.lang.Object
com.ibm.wala.shrike.shrikeCT.ClassWriter.Element
com.ibm.wala.shrike.shrikeCT.LocalVariableTableWriter

public final class LocalVariableTableWriter extends ClassWriter.Element
This class helps emit LocalVariableTable attributes.
  • Constructor Details

  • 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:
      getSize in class ClassWriter.Element
      Returns:
      the number of bytes that will be generated.
    • copyInto

      public int copyInto(byte[] buf, int offset) throws IllegalArgumentException
      Description copied from class: ClassWriter.Element
      Copy the bytes into 'buf' at offset 'offset'.
      Specified by:
      copyInto in class ClassWriter.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