8243290: Improve diagnostic messages for class verification and redefinition failures
Reviewed-by: coleenp, hseigel, sspitsyn
This commit is contained in:
parent
1b64fb2063
commit
ac4603144d
@ -134,8 +134,15 @@ void Verifier::trace_class_resolution(Klass* resolve_class, InstanceKlass* verif
|
|||||||
void Verifier::log_end_verification(outputStream* st, const char* klassName, Symbol* exception_name, TRAPS) {
|
void Verifier::log_end_verification(outputStream* st, const char* klassName, Symbol* exception_name, TRAPS) {
|
||||||
if (HAS_PENDING_EXCEPTION) {
|
if (HAS_PENDING_EXCEPTION) {
|
||||||
st->print("Verification for %s has", klassName);
|
st->print("Verification for %s has", klassName);
|
||||||
|
oop message = java_lang_Throwable::message(PENDING_EXCEPTION);
|
||||||
|
if (message != NULL) {
|
||||||
|
char* ex_msg = java_lang_String::as_utf8_string(message);
|
||||||
|
st->print_cr(" exception pending '%s %s'",
|
||||||
|
PENDING_EXCEPTION->klass()->external_name(), ex_msg);
|
||||||
|
} else {
|
||||||
st->print_cr(" exception pending %s ",
|
st->print_cr(" exception pending %s ",
|
||||||
PENDING_EXCEPTION->klass()->external_name());
|
PENDING_EXCEPTION->klass()->external_name());
|
||||||
|
}
|
||||||
} else if (exception_name != NULL) {
|
} else if (exception_name != NULL) {
|
||||||
st->print_cr("Verification for %s failed", klassName);
|
st->print_cr("Verification for %s failed", klassName);
|
||||||
}
|
}
|
||||||
|
@ -1308,10 +1308,20 @@ jvmtiError VM_RedefineClasses::load_new_class_versions(TRAPS) {
|
|||||||
the_class->link_class(THREAD);
|
the_class->link_class(THREAD);
|
||||||
if (HAS_PENDING_EXCEPTION) {
|
if (HAS_PENDING_EXCEPTION) {
|
||||||
Symbol* ex_name = PENDING_EXCEPTION->klass()->name();
|
Symbol* ex_name = PENDING_EXCEPTION->klass()->name();
|
||||||
log_info(redefine, class, load, exceptions)("link_class exception: '%s'", ex_name->as_C_string());
|
oop message = java_lang_Throwable::message(PENDING_EXCEPTION);
|
||||||
|
if (message != NULL) {
|
||||||
|
char* ex_msg = java_lang_String::as_utf8_string(message);
|
||||||
|
log_info(redefine, class, load, exceptions)("link_class exception: '%s %s'",
|
||||||
|
ex_name->as_C_string(), ex_msg);
|
||||||
|
} else {
|
||||||
|
log_info(redefine, class, load, exceptions)("link_class exception: '%s'",
|
||||||
|
ex_name->as_C_string());
|
||||||
|
}
|
||||||
CLEAR_PENDING_EXCEPTION;
|
CLEAR_PENDING_EXCEPTION;
|
||||||
if (ex_name == vmSymbols::java_lang_OutOfMemoryError()) {
|
if (ex_name == vmSymbols::java_lang_OutOfMemoryError()) {
|
||||||
return JVMTI_ERROR_OUT_OF_MEMORY;
|
return JVMTI_ERROR_OUT_OF_MEMORY;
|
||||||
|
} else if (ex_name == vmSymbols::java_lang_NoClassDefFoundError()) {
|
||||||
|
return JVMTI_ERROR_INVALID_CLASS;
|
||||||
} else {
|
} else {
|
||||||
return JVMTI_ERROR_INTERNAL;
|
return JVMTI_ERROR_INTERNAL;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user