Package com.ibm.wala.shrike.shrikeCT
Class LineNumberTableWriter
- java.lang.Object
-
- com.ibm.wala.shrike.shrikeCT.ClassWriter.Element
-
- com.ibm.wala.shrike.shrikeCT.LineNumberTableWriter
-
public final class LineNumberTableWriter extends ClassWriter.Element
This class helps emit LineNumberTable attributes.
-
-
Constructor Summary
Constructors Constructor Description LineNumberTableWriter(ClassWriter w)Build an empty LineNumberTable.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcopyInto(byte[] buf, int offset)Copy the bytes into 'buf' at offset 'offset'.intgetSize()static int[]makeRawTable(int[] newLineMap)voidsetRawTable(int[] table)Set the raw table entries.
-
-
-
Constructor Detail
-
LineNumberTableWriter
public LineNumberTableWriter(ClassWriter w)
Build an empty LineNumberTable.- Throws:
java.lang.IllegalArgumentException- if w is null
-
-
Method Detail
-
setRawTable
public void setRawTable(int[] table)
Set the raw table entries. Consider calling LineNumberTableWriter.makeRawTable to build the raw entries.- Parameters:
table- a flattened sequence of (startPC, lineNumber) pairs
-
getSize
public int getSize()
- Specified by:
getSizein classClassWriter.Element- Returns:
- the number of bytes that will be generated.
-
copyInto
public int copyInto(byte[] buf, int offset) throws java.lang.IllegalArgumentExceptionDescription 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:
java.lang.IllegalArgumentException
-
makeRawTable
public static int[] makeRawTable(int[] newLineMap) throws java.lang.IllegalArgumentException- Parameters:
newLineMap- an array indexed by bytecode offset, mapping each bytecode offset to its line number (or 0 if there is no line or it's not known)- Returns:
- the line numbers in "raw" format, a flattened sequence of (startPC, lineNumber) pairs
- Throws:
java.lang.IllegalArgumentException- if newLineMap == null
-
-