Methods Summary |
---|
public boolean | containsLine(int lineNumber)Determine if this lineNumber table contains the specified source file
line number.
boolean found = false;
int index = 0;
//loop through each entry in the line number table until
//the specified line number is found or there are no
//entries left
while ((!found) && (index < lineNumberTableLength))
{
if (lineNumber == lineNumberTable[index].lineNumber)
found = true;
else
++index;
}
return found;
|
public int | getCodeIndexBySourceLineNumber(int lineNumber)Returns the first code index associated with the specified source
file line number.
boolean found = false;
int index = 0;
//loop through line number table until we find an entry with the
//specified source file line number or run out of entries
while ((!found) && (index < lineNumberTableLength))
{
if (lineNumber == lineNumberTable[index].lineNumber)
found = true;
else
++index;
}
//if an entry was found return the code array index associated with it
if (found)
return (lineNumberTable[index].startPC);
else
return -1; //no entry found so return -1
|
public int | getCurrentLineCodeIndex(long offset)
int currentIndex = getIndexThatContainsOpcode(offset);
Log.LOGN(3, "getCurrent: index=" + currentIndex);
return currentIndex;
|
public int | getDupCurrentExecutableLineCodeIndex(long offset)
int firstIndex = getNextExecutableLineCodeIndex(offset, false);
if (firstIndex == -1)
return -1;
firstIndex--;
return getOtherLineIndex(firstIndex);
|
private int | getIndexThatContainsOpcode(long offset)Returns the line that this opcode offset lies on
for (int i=0; i < lineNumberTableLength - 1; i++) {
if (offset >= lineNumberTable[ i ].startPC &&
offset < lineNumberTable[ i + 1 ].startPC) {
return i;
}
}
if (offset >= lineNumberTable[ lineNumberTableLength - 1 ].startPC)
return lineNumberTableLength - 1;
return -1; // lineNumberTable[ 0 ].lineNumber;
|
public int | getLineNumberFromIndex(int index)
if (index == -1 || index == lineNumberTableLength - 1)
return (-1);
return lineNumberTable[index].lineNumber;
|
public int[][] | getLineNumbersAndIndicesAsArray()
int lineArray[][] = new int[lineNumberTableLength][2];
for (int lcv = 0; lcv < lineNumberTableLength; ++lcv)
{
lineArray[lcv][0] = lineNumberTable[lcv].lineNumber;
lineArray[lcv][1] = lineNumberTable[lcv].startPC;
}
return lineArray;
|
public int | getNextExecutableLineCodeIndex(long offset)
return getNextExecutableLineCodeIndex(offset, true);
|
private int | getNextExecutableLineCodeIndex(long offset, boolean logging)
int firstIndex = getIndexThatContainsOpcode(offset);
if (logging)
Log.LOGN(3, "getNext: firstIndex=" + firstIndex);
int otherIndex;
if ((otherIndex = getOtherLineIndex(firstIndex)) != -1) {
if (logging)
Log.LOGN(3, "getNext: otherIndex=" + otherIndex);
if (otherIndex < firstIndex) {
if (logging)
Log.LOGN(3, "getNext: otherIndex < firstIndex");
return otherIndex + 1;
} else {
if (logging)
Log.LOGN(3, "getNext: otherIndex > firstIndex");
return firstIndex + 1;
}
}
if (firstIndex+1 < lineNumberTableLength)
return firstIndex + 1;
else
return -1;
|
public long | getOffsetofDupNextLine(int index)
if (index == -1 || index == lineNumberTableLength - 1)
return -1;
return lineNumberTable[index + 1].startPC;
|
private int | getOtherLineIndex(int index)
for (int i=0; i < lineNumberTableLength; i++) {
if (i == index) continue;
if (lineNumberTable[ i ].lineNumber ==
lineNumberTable[ index ].lineNumber) {
return i;
}
}
return -1;
|
public long | getStartPCFromIndex(int index)
if (index == -1)
return -1;
return lineNumberTable[index].startPC;
|
public java.lang.String | toString(ConstantPoolInfo[] constantPool)Returns the LineNumberTableAttribute attribute in a nice easy to
read format as a string.
ConstantUtf8Info utf8Info;
String s = new String ("");
utf8Info = (ConstantUtf8Info) constantPool[attributeNameIndex];
s = s + "\t" + utf8Info.toString ();
/*
for (int lcv = 0; lcv < lineNumberTableLength; ++lcv)
{
s = s + "\n\t\t\t\tStart PC= " + lineNumberTable[lcv].startPC;
s = s + "\tLine Number= " + lineNumberTable[lcv].lineNumber;
}
*/
return s;
|