private void printJavaStackFrameInfo(JavaThread jt, Output out)
{
Iterator itStackFrame;
JavaStackFrame jsf;
JavaLocation jl;
itStackFrame = jt.getStackFrames().iterator();
if (!itStackFrame.hasNext()) {
out.print("<no frames to print>\n");
return;
} else {
out.print("\n");
}
while (itStackFrame.hasNext()) {
// this iterator can contain JavaStackFrame or CorruptData objects
Object next = itStackFrame.next();
if (next instanceof CorruptData) {
out.print("\t " + Exceptions.getCorruptDataExceptionString() + "\n");
return;
} else {
jsf = (JavaStackFrame)next;
}
try {
jl = jsf.getLocation();
} catch (CorruptDataException e) {
out.print("\t " + Exceptions.getCorruptDataExceptionString()+ "\n");
return;
}
out.print("\t bp: ");
try {
out.print(toAdjustedHex(jsf.getBasePointer().getAddress()));
} catch (CorruptDataException e) {
out.print(Exceptions.getCorruptDataExceptionString());
}
out.print(" method: ");
try {
String signature = jl.getMethod().getSignature();
out.print(Utils.getReturnValueName(signature) + " " +
jl.getMethod().getDeclaringClass().getName() + "." +
jl.getMethod().getName() +
Utils.getMethodSignatureName(signature)
);
} catch (CorruptDataException e) {
out.print(Exceptions.getCorruptDataExceptionString());
} catch (DataUnavailable e) {
out.print(Exceptions.getDataUnavailableString());
}
out.print(" filename:line: ");
try {
out.print(jl.getFilename());
} catch (DataUnavailable d) {
out.print(Exceptions.getDataUnavailableString());
} catch (CorruptDataException e) {
out.print(Exceptions.getCorruptDataExceptionString());
}
out.print(":");
try {
out.print(Integer.toString(jl.getLineNumber()));
} catch (DataUnavailable d) {
out.print(Exceptions.getDataUnavailableString());
} catch (CorruptDataException e) {
out.print(Exceptions.getCorruptDataExceptionString());
}