ART: Dump native stack on recursive abort
Dump the native stack of the current thread on recursive abort.
That is safe to do, as it requires no runtime interaction.
Test: m test-art-host
Change-Id: I4e052916f1036c74dc9fa82b049b4574626a70bb
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index 0e17032..771ac27 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -372,6 +372,9 @@
void Dump(std::ostream& os) const {
if (gAborting > 1) {
os << "Runtime aborting --- recursively, so no thread-specific detail!\n";
+ if (gAborting == 2) {
+ DumpRecursiveAbort(os);
+ }
return;
}
gAborting++;
@@ -428,6 +431,12 @@
}
}
}
+
+ // For recursive aborts.
+ void DumpRecursiveAbort(std::ostream& os) const NO_THREAD_SAFETY_ANALYSIS {
+ // The only thing we'll attempt is dumping the native stack of the current thread.
+ DumpNativeStack(os, GetTid());
+ }
};
void Runtime::Abort(const char* msg) {