diff options
author | Christopher Ferris <cferris@google.com> | 2013-10-29 15:44:25 -0700 |
---|---|---|
committer | Christopher Ferris <cferris@google.com> | 2013-10-30 14:14:54 -0700 |
commit | 8ed46278bee3cfc4c216f3a1524744019b693200 (patch) | |
tree | 5f6eab2ef98469e75dc1d1793b134ee61715cac5 /include/backtrace | |
parent | 98f87d92d89079f274374409efcf57ca52b13c1f (diff) | |
download | system_core-8ed46278bee3cfc4c216f3a1524744019b693200.zip system_core-8ed46278bee3cfc4c216f3a1524744019b693200.tar.gz system_core-8ed46278bee3cfc4c216f3a1524744019b693200.tar.bz2 |
More libbacktrace fixes.
Included in minor fix ups is the addition of a warning macro to replace
all of the ALOGW calls.
Fix a race where multiple threads could be attempting to unwind the threads
of the current process at the same time.
Bug: 8410085
Change-Id: I02a65dc778dde690e5f95fc8ff069a32d0832fd1
Diffstat (limited to 'include/backtrace')
-rw-r--r-- | include/backtrace/Backtrace.h | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/include/backtrace/Backtrace.h b/include/backtrace/Backtrace.h index 0b75e83..b15678c 100644 --- a/include/backtrace/Backtrace.h +++ b/include/backtrace/Backtrace.h @@ -25,7 +25,16 @@ class BacktraceImpl; class Backtrace { public: - Backtrace(BacktraceImpl* impl); + // Create the correct Backtrace object based on what is to be unwound. + // If pid < 0 or equals the current pid, then the Backtrace object + // corresponds to the current process. + // If pid < 0 or equals the current pid and tid >= 0, then the Backtrace + // object corresponds to a thread in the current process. + // If pid >= 0 and tid < 0, then the Backtrace object corresponds to a + // different process. + // Tracing a thread in a different process is not supported. + static Backtrace* Create(pid_t pid, pid_t tid); + virtual ~Backtrace(); // Get the current stack trace and store in the backtrace_ structure. @@ -60,17 +69,9 @@ public: return &backtrace_.frames[frame_num]; } - // Create the correct Backtrace object based on what is to be unwound. - // If pid < 0 or equals the current pid, then the Backtrace object - // corresponds to the current process. - // If pid < 0 or equals the current pid and tid >= 0, then the Backtrace - // object corresponds to a thread in the current process. - // If pid >= 0 and tid < 0, then the Backtrace object corresponds to a - // different process. - // Tracing a thread in a different process is not supported. - static Backtrace* Create(pid_t pid, pid_t tid); - protected: + Backtrace(BacktraceImpl* impl); + virtual bool VerifyReadWordArgs(uintptr_t ptr, uint32_t* out_value); BacktraceImpl* impl_; |