ART: Pass ucontext to Backtrace in Stack Dump

In case of an unexpected signal on the host we dump the thread stack
ourselves. We have to pass the context given to the signal handler,
as the signal handler is run on an alternate stack. Otherwise
libbacktrace can't dump the actual faulty part.

Bug: 18933933
Change-Id: Id2710d2fd44b7c3b3335973a9288979a5793638b
diff --git a/runtime/utils.cc b/runtime/utils.cc
index 1211547..7234ec0 100644
--- a/runtime/utils.cc
+++ b/runtime/utils.cc
@@ -1118,7 +1118,7 @@
 }
 
 void DumpNativeStack(std::ostream& os, pid_t tid, const char* prefix,
-    mirror::ArtMethod* current_method) {
+    mirror::ArtMethod* current_method, void* ucontext_ptr) {
 #if __linux__
   // b/18119146
   if (RUNNING_ON_VALGRIND != 0) {
@@ -1134,7 +1134,7 @@
 #endif
 
   std::unique_ptr<Backtrace> backtrace(Backtrace::Create(BACKTRACE_CURRENT_PROCESS, tid));
-  if (!backtrace->Unwind(0)) {
+  if (!backtrace->Unwind(0, reinterpret_cast<ucontext*>(ucontext_ptr))) {
     os << prefix << "(backtrace::Unwind failed for thread " << tid << ")\n";
     return;
   } else if (backtrace->NumFrames() == 0) {