From 369c8513cb23dbd18267da5479947ccf59997a57 Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Thu, 28 Jan 2016 15:31:39 -0800 Subject: [PATCH] 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 --- runtime/class_linker.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc index 262505b53..2c6f97985 100644 --- a/runtime/class_linker.cc +++ b/runtime/class_linker.cc @@ -164,10 +164,12 @@ void ClassLinker::ThrowEarlierClassFailure(mirror::Class* c, bool wrap_in_no_cla 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; } -- 2.11.0