diff options
author | Mathieu Chartier <mathieuc@google.com> | 2015-05-04 18:17:40 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-05-04 18:17:40 +0000 |
commit | a93b104b47da67eaa50f8a6b7280cc6c438ef37b (patch) | |
tree | 366031de80c69132c28aba01b4ff4258cb82ffc9 | |
parent | a6f2a7e01433926339866afc2b413770774c6d9f (diff) | |
parent | 5c02d6cd0cc7e10d30d8c26166ebaaf6d313d771 (diff) | |
download | art-a93b104b47da67eaa50f8a6b7280cc6c438ef37b.zip art-a93b104b47da67eaa50f8a6b7280cc6c438ef37b.tar.gz art-a93b104b47da67eaa50f8a6b7280cc6c438ef37b.tar.bz2 |
Merge "Improve JNI registration failure logging"
-rw-r--r-- | runtime/jni_internal.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/runtime/jni_internal.cc b/runtime/jni_internal.cc index fc3826b..9bb08a2 100644 --- a/runtime/jni_internal.cc +++ b/runtime/jni_internal.cc @@ -2109,10 +2109,12 @@ class JNI { m = c->FindVirtualMethod(name, sig); } if (m == nullptr) { - c->DumpClass(LOG(ERROR), mirror::Class::kDumpClassFullDetail); - LOG(return_errors ? ERROR : FATAL) << "Failed to register native method " + LOG(return_errors ? ERROR : INTERNAL_FATAL) << "Failed to register native method " << PrettyDescriptor(c) << "." << name << sig << " in " << c->GetDexCache()->GetLocation()->ToModifiedUtf8(); + // Safe to pass in LOG(FATAL) since the log object aborts in destructor and only goes + // out of scope after the DumpClass is done executing. + c->DumpClass(LOG(return_errors ? ERROR : FATAL), mirror::Class::kDumpClassFullDetail); ThrowNoSuchMethodError(soa, c, name, sig, "static or non-static"); return JNI_ERR; } else if (!m->IsNative()) { |