diff options
| author | Yabin Cui <yabinc@google.com> | 2017-12-12 18:04:10 -0800 |
|---|---|---|
| committer | Yabin Cui <yabinc@google.com> | 2017-12-15 13:29:53 -0800 |
| commit | f88082811a87e3e088b926d0e0fa90688e02d258 (patch) | |
| tree | f338ee9f0e5e0c061fde9e3a39f2f27f9e457958 /libbacktrace/BacktraceCurrent.cpp | |
| parent | 80bfeeef884e08b3a6aa593b1a35217b01e1b855 (diff) | |
| download | system_core-f88082811a87e3e088b926d0e0fa90688e02d258.tar.gz system_core-f88082811a87e3e088b926d0e0fa90688e02d258.tar.bz2 system_core-f88082811a87e3e088b926d0e0fa90688e02d258.zip | |
libbacktrace: export offline unwinding failures.
This is to help debugging different offline unwiding failures.
Bug: http://b/69383534
Test: run backtrace_test.
Change-Id: I5ed4837027a9f17d032925e97e9f5927161444b3
Diffstat (limited to 'libbacktrace/BacktraceCurrent.cpp')
| -rw-r--r-- | libbacktrace/BacktraceCurrent.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libbacktrace/BacktraceCurrent.cpp b/libbacktrace/BacktraceCurrent.cpp index fb76b858d..474d09924 100644 --- a/libbacktrace/BacktraceCurrent.cpp +++ b/libbacktrace/BacktraceCurrent.cpp @@ -67,11 +67,11 @@ size_t BacktraceCurrent::Read(uintptr_t addr, uint8_t* buffer, size_t bytes) { bool BacktraceCurrent::Unwind(size_t num_ignore_frames, ucontext_t* ucontext) { if (GetMap() == nullptr) { // Without a map object, we can't do anything. - error_ = BACKTRACE_UNWIND_ERROR_MAP_MISSING; + error_.error_code = BACKTRACE_UNWIND_ERROR_MAP_MISSING; return false; } - error_ = BACKTRACE_UNWIND_NO_ERROR; + error_.error_code = BACKTRACE_UNWIND_NO_ERROR; if (ucontext) { return UnwindFromContext(num_ignore_frames, ucontext); } @@ -163,7 +163,7 @@ bool BacktraceCurrent::UnwindThread(size_t num_ignore_frames) { BACK_ASYNC_SAFE_LOGE("sigaction failed: %s", strerror(errno)); ThreadEntry::Remove(entry); pthread_mutex_unlock(&g_sigaction_mutex); - error_ = BACKTRACE_UNWIND_ERROR_INTERNAL; + error_.error_code = BACKTRACE_UNWIND_ERROR_INTERNAL; return false; } @@ -171,9 +171,9 @@ bool BacktraceCurrent::UnwindThread(size_t num_ignore_frames) { // Do not emit an error message, this might be expected. Set the // error and let the caller decide. if (errno == ESRCH) { - error_ = BACKTRACE_UNWIND_ERROR_THREAD_DOESNT_EXIST; + error_.error_code = BACKTRACE_UNWIND_ERROR_THREAD_DOESNT_EXIST; } else { - error_ = BACKTRACE_UNWIND_ERROR_INTERNAL; + error_.error_code = BACKTRACE_UNWIND_ERROR_INTERNAL; } sigaction(THREAD_SIGNAL, &oldact, nullptr); @@ -218,9 +218,9 @@ bool BacktraceCurrent::UnwindThread(size_t num_ignore_frames) { } else { // Check to see if the thread has disappeared. if (tgkill(Pid(), Tid(), 0) == -1 && errno == ESRCH) { - error_ = BACKTRACE_UNWIND_ERROR_THREAD_DOESNT_EXIST; + error_.error_code = BACKTRACE_UNWIND_ERROR_THREAD_DOESNT_EXIST; } else { - error_ = BACKTRACE_UNWIND_ERROR_THREAD_TIMEOUT; + error_.error_code = BACKTRACE_UNWIND_ERROR_THREAD_TIMEOUT; BACK_ASYNC_SAFE_LOGE("Timed out waiting for signal handler to get ucontext data."); } } |
