Create stack traces in unstarted runtimes.
Use to diagnose failed initialization in dex2oat of boot (-verbose:compiler).
Fix identity hashCode, ArtMethod.getMethodName, IntegralToString.convertInt and
use of Void when called from a unstarted runtime.
Change-Id: I2d536174b59e2e5f19519f93fc6b5916652fb6cd
diff --git a/runtime/thread.cc b/runtime/thread.cc
index e67a64f..23a6779 100644
--- a/runtime/thread.cc
+++ b/runtime/thread.cc
@@ -1639,6 +1639,13 @@
if (cause.get() != nullptr) {
exception->SetCause(down_cast<mirror::Throwable*>(DecodeJObject(cause.get())));
}
+ ScopedLocalRef<jobject> trace(GetJniEnv(),
+ Runtime::Current()->IsActiveTransaction()
+ ? CreateInternalStackTrace<true>(soa)
+ : CreateInternalStackTrace<false>(soa));
+ if (trace.get() != nullptr) {
+ exception->SetStackState(down_cast<mirror::Throwable*>(DecodeJObject(trace.get())));
+ }
ThrowLocation gc_safe_throw_location(saved_throw_this.get(), saved_throw_method.get(),
throw_location.GetDexPc());
SetException(gc_safe_throw_location, exception.get());