ART: Dump full exception on re-init failure message
It is a recurring issue to investigate the underlying issue. Just
dumping the top-level failure type is not very helpful. Take the
logcat hit and dump the full exception (including causes).
Change-Id: If071df9667473410222438e1c5f956c9b56b4d77
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index 262505b..2c6f979 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -164,10 +164,12 @@
if (!runtime->IsAotCompiler()) { // Give info if this occurs at runtime.
std::string extra;
if (c->GetVerifyError() != nullptr) {
- mirror::Class* descr_from = c->GetVerifyError()->IsClass()
- ? c->GetVerifyError()->AsClass()
- : c->GetVerifyError()->GetClass();
- extra = PrettyDescriptor(descr_from);
+ mirror::Object* verify_error = c->GetVerifyError();
+ if (verify_error->IsClass()) {
+ extra = PrettyDescriptor(verify_error->AsClass());
+ } else {
+ extra = verify_error->AsThrowable()->Dump();
+ }
}
LOG(INFO) << "Rejecting re-init on previously-failed class " << PrettyClass(c) << ": " << extra;
}