diff options
| author | Elliott Hughes <enh@google.com> | 2018-07-11 11:13:16 -0700 |
|---|---|---|
| committer | Elliott Hughes <enh@google.com> | 2018-07-11 13:55:07 -0700 |
| commit | 38488907a09c88d2c3954a2dc69e5a4785d6a5af (patch) | |
| tree | 160d2c2cca2c491e1b905793e6f0d6b90d78beef /libbacktrace/BacktraceCurrent.cpp | |
| parent | 1db3789252342c5bfd34d889792866c3b4357b0c (diff) | |
| download | system_core-38488907a09c88d2c3954a2dc69e5a4785d6a5af.tar.gz system_core-38488907a09c88d2c3954a2dc69e5a4785d6a5af.tar.bz2 system_core-38488907a09c88d2c3954a2dc69e5a4785d6a5af.zip | |
Move libbacktrace off cutils.
There's still <cutils/atomic.h> in a test, but I don't understand why
that isn't just std::atomic.
Also add a shared tgkill wrapper to libbase.
Bug: N/A
Test: ran tests
Change-Id: Idd4baa1e1670a84b3a8f35803cc5ffe5aae008a6
Diffstat (limited to 'libbacktrace/BacktraceCurrent.cpp')
| -rw-r--r-- | libbacktrace/BacktraceCurrent.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/libbacktrace/BacktraceCurrent.cpp b/libbacktrace/BacktraceCurrent.cpp index f6f4423a1..39cb995c5 100644 --- a/libbacktrace/BacktraceCurrent.cpp +++ b/libbacktrace/BacktraceCurrent.cpp @@ -28,13 +28,13 @@ #include <string> +#include <android-base/threads.h> #include <backtrace/Backtrace.h> #include <backtrace/BacktraceMap.h> #include "BacktraceAsyncSafeLog.h" #include "BacktraceCurrent.h" #include "ThreadEntry.h" -#include "thread_utils.h" bool BacktraceCurrent::ReadWord(uint64_t ptr, word_t* out_value) { if (!VerifyReadWordArgs(ptr, out_value)) { @@ -76,7 +76,7 @@ bool BacktraceCurrent::Unwind(size_t num_ignore_frames, void* ucontext) { return UnwindFromContext(num_ignore_frames, ucontext); } - if (Tid() != gettid()) { + if (Tid() != android::base::GetThreadId()) { return UnwindThread(num_ignore_frames); } @@ -114,16 +114,17 @@ class ErrnoRestorer { static void SignalLogOnly(int, siginfo_t*, void*) { ErrnoRestorer restore; - BACK_ASYNC_SAFE_LOGE("pid %d, tid %d: Received a spurious signal %d\n", getpid(), gettid(), - THREAD_SIGNAL); + BACK_ASYNC_SAFE_LOGE("pid %d, tid %d: Received a spurious signal %d\n", getpid(), + static_cast<int>(android::base::GetThreadId()), THREAD_SIGNAL); } static void SignalHandler(int, siginfo_t*, void* sigcontext) { ErrnoRestorer restore; - ThreadEntry* entry = ThreadEntry::Get(getpid(), gettid(), false); + ThreadEntry* entry = ThreadEntry::Get(getpid(), android::base::GetThreadId(), false); if (!entry) { - BACK_ASYNC_SAFE_LOGE("pid %d, tid %d entry not found", getpid(), gettid()); + BACK_ASYNC_SAFE_LOGE("pid %d, tid %d entry not found", getpid(), + static_cast<int>(android::base::GetThreadId())); return; } |
