diff options
author | 2015-01-08 17:38:02 +0000 | |
---|---|---|
committer | 2015-01-08 17:38:02 +0000 | |
commit | 553727e466942a10e11ee39dcb67e3f9562b471e (patch) | |
tree | 3071b04254e7e61d4060a6db473a14529f848da4 /runtime/runtime_linux.cc | |
parent | 97d091d0a1667592e15bac44e21dc94f9fc032fc (diff) | |
parent | 628a61ac52a8a314e74ab445397add60b4e72a5b (diff) |
Merge "ART: Pass ucontext to Backtrace in Stack Dump"
Diffstat (limited to 'runtime/runtime_linux.cc')
-rw-r--r-- | runtime/runtime_linux.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/runtime/runtime_linux.cc b/runtime/runtime_linux.cc index 1de035c0d5..a5a02042ac 100644 --- a/runtime/runtime_linux.cc +++ b/runtime/runtime_linux.cc @@ -35,9 +35,16 @@ namespace art { static constexpr bool kDumpHeapObjectOnSigsevg = false; struct Backtrace { + public: + explicit Backtrace(void* raw_context) : raw_context_(raw_context) {} void Dump(std::ostream& os) const { - DumpNativeStack(os, GetTid(), "\t"); + DumpNativeStack(os, GetTid(), "\t", nullptr, raw_context_); } + private: + // Stores the context of the signal that was unexpected and will terminate the runtime. The + // DumpNativeStack code will take care of casting it to the expected type. This is required + // as our signal handler runs on an alternate stack. + void* raw_context_; }; struct OsInfo { @@ -298,7 +305,7 @@ void HandleUnexpectedSignal(int signal_number, siginfo_t* info, void* raw_contex pid_t tid = GetTid(); std::string thread_name(GetThreadName(tid)); UContext thread_context(raw_context); - Backtrace thread_backtrace; + Backtrace thread_backtrace(raw_context); LOG(INTERNAL_FATAL) << "*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***\n" << StringPrintf("Fatal signal %d (%s), code %d (%s)", |