summaryrefslogtreecommitdiffstats
path: root/include/backtrace
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2014-05-06 15:23:59 -0700
committerChristopher Ferris <cferris@google.com>2014-05-08 14:42:16 -0700
commita2efd3ac7abe223aa7a8ba8b5ba448216c4953b4 (patch)
tree4af24fc95846166c6891d4b23b7ca761aaa6b1b3 /include/backtrace
parentb52a48affc77232047a599afa3e567c0a8c01b69 (diff)
downloadsystem_core-a2efd3ac7abe223aa7a8ba8b5ba448216c4953b4.zip
system_core-a2efd3ac7abe223aa7a8ba8b5ba448216c4953b4.tar.gz
system_core-a2efd3ac7abe223aa7a8ba8b5ba448216c4953b4.tar.bz2
Rewrite unwind thread handling.
This new version doesn't require any specialized thread implementation, it uses the Current implementation to do its job. In addition, it runs much faster when multiple threads are trying to unwind at the same time since the global signal lock is held for only a small amount of time. Even running through the threads one at a time should be faster since it no longer requires two passes through the unwound stacks. The new code now allows multiple simultaneous unwinds of the same thread. Finally, add the ability to unwind from a ucontext_t passed in. This functionality doesn't work for remote unwinds yet. Change-Id: I4d181d7ca5ffd2acfd1686e668e6d21e36b425cb
Diffstat (limited to 'include/backtrace')
-rw-r--r--include/backtrace/Backtrace.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/backtrace/Backtrace.h b/include/backtrace/Backtrace.h
index 3c3a482..561dfeb 100644
--- a/include/backtrace/Backtrace.h
+++ b/include/backtrace/Backtrace.h
@@ -19,6 +19,7 @@
#include <inttypes.h>
#include <stdint.h>
+#include <ucontext.h>
#include <string>
#include <vector>
@@ -64,7 +65,7 @@ public:
virtual ~Backtrace();
// Get the current stack trace and store in the backtrace_ structure.
- virtual bool Unwind(size_t num_ignore_frames);
+ virtual bool Unwind(size_t num_ignore_frames, ucontext_t* context = NULL);
// Get the function name and offset into the function given the pc.
// If the string is empty, then no valid function name was found.