JavaThread thd = (JavaThread) tmpobj;
Iterator frames = thd.getStackFrames().iterator();
while(frames.hasNext()){
JavaStackFrame jStackFrame = (JavaStackFrame)frames.next();
JavaLocation jLocation = jStackFrame.getLocation();
JavaMethod jMethod = jLocation.getMethod();
JavaClass jClass = jMethod.getDeclaringClass();
if (getMethodId(refType, jMethod) == methodID && jClass.getID().getAddress() == refType){
int line = -1;
try{
line = jLocation.getLineNumber();
}
catch(CorruptDataException exxy){
logr.log(JDILogger.LEVEL_VERYVERBOSE, " CorruptData for:"); //$NON-NLS-1$
}
catch(DataUnavailable exxy){
logr.log(JDILogger.LEVEL_VERYVERBOSE, " DataUnavailable for:"); //$NON-NLS-1$
}
Vector<Byte> vctr = new Vector<Byte>();
if (line > 0){
int lowest = findLowestLineRef(refType, methodID) - 1;
int highest = findHighestLineRef(refType, methodID) + 1;
logr.log(JDILogger.LEVEL_VERYVERBOSE, " (L)" + jClass.getName() + "." + jMethod.getName() + ":" + lowest + "<" + line + ">" + highest); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
// //Code index start
// addLongToVector(vctr, lowest);
// //Code index end
// addLongToVector(vctr, highest);
// //Number of lines
// addIntToVector(vctr, highest - lowest);
// for(int i = lowest; i <= highest; i++){
// addLongToVector(vctr, i);
// addIntToVector(vctr, i);
// }
//Code index start
addLongToVector(vctr, 0);
//Code index end
addLongToVector(vctr, 99999999); // TODO go through local variable tables looking for highest reference?
//Number of lines
addIntToVector(vctr, 1);
//for(int i = lowest; i <= highest; i++){
addLongToVector(vctr, jLocation.getAddress().getAddress()-1);
addIntToVector(vctr, jLocation.getLineNumber());
//}
}else{
logr.log(JDILogger.LEVEL_VERYVERBOSE, " (N)" + jClass.getName() + "." + jMethod.getName() + ":" + line); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
//Code index start
addLongToVector(vctr, -1);
//Code index end
addLongToVector(vctr, -1);
//Number of lines
//We're native right now.
addIntToVector(vctr, 0);
}
ReplyPacket rpckt = new ReplyPacket(cpckt.getSequence(), FLAG_REPLY_PACKET, ERROR_NONE);
rpckt.setData(vectorToByte(vctr));
return rpckt;
}
}
}
}
}
}
}
Vector<Byte> vctr = new Vector<Byte>();
addLongToVector(vctr, -1);
//Code index end
addLongToVector(vctr, -1);
//Number of lines
//We're native right now.
addIntToVector(vctr, 0);
ReplyPacket rpckt = new ReplyPacket(cpckt.getSequence(), FLAG_REPLY_PACKET, ERROR_NONE);
rpckt.setData(vectorToByte(vctr));
return rpckt;
}else if (cpckt.getCommand() == 2){
byte [] inData = cpckt.getByteData();
long refType = createLongFromBytes(inData, 0, 8);
long methodID = createLongFromBytes(inData, 8, 8);
logr.log(JDILogger.LEVEL_VERBOSE, "Method.VariableTable(" + refType + "," + methodID + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
int slotsUsed = 0;
Iterator asIt = image.getAddressSpaces( ).iterator();
while ( asIt.hasNext( ) )
{
ImageAddressSpace as = (ImageAddressSpace) asIt.next( );
Iterator prIt = as.getProcesses( ).iterator();
while ( prIt.hasNext( ) )
{
ImageProcess process = (ImageProcess) prIt.next( );
Iterator runTimesIt = process.getRuntimes( ).iterator();
while ( runTimesIt.hasNext( ) )
{
JavaRuntime javaRT = (JavaRuntime) runTimesIt.next( );
Iterator thds = javaRT.getThreads().iterator();
while(thds.hasNext()){
Object tmpobj = thds.next();
if (tmpobj instanceof CorruptData){
//ignore this thread
}else{
JavaThread thd = (JavaThread) tmpobj;
Iterator frames = thd.getStackFrames().iterator();
while(frames.hasNext()){
JavaStackFrame jStackFrame = (JavaStackFrame)frames.next();
JavaLocation jLocation = jStackFrame.getLocation();
JavaMethod jMethod = jLocation.getMethod();
JavaClass jClass = jMethod.getDeclaringClass();
if (getMethodId(refType, jMethod) == methodID && jClass.getID().getAddress() == refType){
Vector<Byte> vctr = new Vector<Byte>();
List vars = jMethod.getVariables();
String sig = jMethod.getSignature();
addIntToVector(vctr, methodSignatureSize(sig));
addIntToVector(vctr, vars.size());
logr.log(JDILogger.LEVEL_VERYVERBOSE, " "+jLocation+