-
Notifications
You must be signed in to change notification settings - Fork 1
/
backtrace.dump.fail.tid.patch
executable file
·63 lines (56 loc) · 1.81 KB
/
backtrace.dump.fail.tid.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
diff --git a/libbacktrace/Android.mk b/libbacktrace/Android.mk
index 9588dd6..6680d33 100755
--- a/libbacktrace/Android.mk
+++ b/libbacktrace/Android.mk
@@ -45,6 +45,7 @@ libbacktrace_src_files := \
libbacktrace_shared_libraries_target := \
libcutils \
libgccdemangle \
+ libdebughelper \
libbacktrace_src_files += \
UnwindCurrent.cpp \
@@ -53,6 +54,7 @@ libbacktrace_src_files += \
libbacktrace_c_includes := \
external/libunwind/include \
+ external/libdebughelper/ \
libbacktrace_shared_libraries := \
libunwind \
@@ -90,6 +92,7 @@ libbacktrace_libc++_src_files := \
libbacktrace_libc++_shared_libraries_target := \
libcutils \
libgccdemangle \
+ libdebughelper \
libbacktrace_libc++_src_files += \
UnwindCurrent.cpp \
@@ -98,6 +101,7 @@ libbacktrace_libc++_src_files += \
libbacktrace_libc++_c_includes := \
external/libunwind/include \
+ external/libdebughelper/ \
libbacktrace_libc++_shared_libraries := \
libunwind \
diff --git a/libbacktrace/BacktraceThread.cpp b/libbacktrace/BacktraceThread.cpp
index 439cc3b..fe7a2ec 100644
--- a/libbacktrace/BacktraceThread.cpp
+++ b/libbacktrace/BacktraceThread.cpp
@@ -107,6 +107,10 @@ ThreadEntry::~ThreadEntry() {
pthread_cond_destroy(&wait_cond_);
}
+#ifdef HAVE_ANDROID_OS
+#include "debughelper.h"
+#endif
+
void ThreadEntry::Wait(int value) {
timespec ts;
if (clock_gettime(CLOCK_MONOTONIC, &ts) == -1) {
@@ -119,7 +123,10 @@ void ThreadEntry::Wait(int value) {
while (wait_value_ != value) {
int ret = pthread_cond_timedwait(&wait_cond_, &wait_mutex_, &ts);
if (ret != 0) {
- BACK_LOGW("pthread_cond_timedwait failed: %s", strerror(ret));
+ BACK_LOGW("pthread_cond_timedwait failed:(%d,%d) %s", pid_, tid_, strerror(ret));
+#ifdef HAVE_ANDROID_OS
+ DebugHelper::dumpAllKernelStack();
+#endif
break;
}
}