* method.getBytecodeSize()); Screen.debug(method.getName());
*/
// }
final int count;
final VmByteCode bc = method.getBytecode();
final VmCompiledCode cc = reader.getCompiledCode(frame);
if (bc != null) {
count = bc.getNoExceptionHandlers();
} else {
count = 0;
}
// Screen.debug("eCount=" + count);
for (int i = 0; i < count; i++) {
final AbstractExceptionHandler eh;
final VmCompiledExceptionHandler ceh;
ceh = cc.getExceptionHandler(i);
eh = ceh;
boolean match;
match = ceh.isInScope(address);
if (match) {
final VmConstClass catchType = eh.getCatchType();
if (catchType == null) {
/* Catch all exceptions */
return Address.fromAddress(ceh.getHandler());
} else {
if (!catchType.isResolved()) {
SoftByteCodes.resolveClass(catchType);
}
final VmType handlerClass = catchType
.getResolvedVmClass();
if (handlerClass != null) {
if (handlerClass.isAssignableFrom(exClass)) {
return Address.fromAddress(ceh.getHandler());
}
} else {
System.err
.println("Warning: handler class==null in "
+ method.getName());
}
}
}
}
if (cc.contains(address)) {
return Address.fromAddress(cc.getDefaultExceptionHandler());
} else {
return null;
}
} catch (Throwable ex2) {
Unsafe.debug("Exception in findThrowableHandler");