summaryrefslogtreecommitdiffstats
path: root/include/backtrace
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2015-09-19 02:08:35 +0000
committerYabin Cui <yabinc@google.com>2015-09-21 12:54:45 -0700
commit0a411c934a81e5c77a27ef5b69d391038f36e969 (patch)
treeb21082ce26df5d7115f364ccb57d57f77e6bb4f2 /include/backtrace
parentee08fb53bb59cb5037755d68de09e6e5bc3f8bc6 (diff)
downloadcore-0a411c934a81e5c77a27ef5b69d391038f36e969.tar.gz
core-0a411c934a81e5c77a27ef5b69d391038f36e969.tar.bz2
core-0a411c934a81e5c77a27ef5b69d391038f36e969.zip
Revert "Revert "Add BacktraceOffline for offline backtracing.""
This reverts commit ab5e583327e4dfd9f7c38ab6ed4c4714508ce544. And statically link llvm libraries on host to remove dependency on 32-bit llvm shared library which is not included in the prebuilt. Bug: 22229391 Change-Id: I8210687655ee1809fd820ab2a6ca5dfaf3f9096d
Diffstat (limited to 'include/backtrace')
-rw-r--r--include/backtrace/Backtrace.h14
-rw-r--r--include/backtrace/BacktraceMap.h3
2 files changed, 17 insertions, 0 deletions
diff --git a/include/backtrace/Backtrace.h b/include/backtrace/Backtrace.h
index 290682a74..f440bd283 100644
--- a/include/backtrace/Backtrace.h
+++ b/include/backtrace/Backtrace.h
@@ -52,6 +52,12 @@ struct ucontext;
typedef ucontext ucontext_t;
#endif
+struct backtrace_stackinfo_t {
+ uint64_t start;
+ uint64_t end;
+ const uint8_t* data;
+};
+
class Backtrace {
public:
// Create the correct Backtrace object based on what is to be unwound.
@@ -66,6 +72,14 @@ public:
// If map is not NULL, the map is still owned by the caller.
static Backtrace* Create(pid_t pid, pid_t tid, BacktraceMap* map = NULL);
+ // Create an offline Backtrace object that can be used to do an unwind without a process
+ // that is still running. If cache_file is set to true, then elf information will be cached
+ // for this call. The cached information survives until the calling process ends. This means
+ // that subsequent calls to create offline Backtrace objects will continue to use the same
+ // cache. It also assumes that the elf files used for each offline unwind are the same.
+ static Backtrace* CreateOffline(pid_t pid, pid_t tid, BacktraceMap* map,
+ const backtrace_stackinfo_t& stack, bool cache_file = false);
+
virtual ~Backtrace();
// Get the current stack trace and store in the backtrace_ structure.
diff --git a/include/backtrace/BacktraceMap.h b/include/backtrace/BacktraceMap.h
index bb18aa2e2..2373c45e8 100644
--- a/include/backtrace/BacktraceMap.h
+++ b/include/backtrace/BacktraceMap.h
@@ -31,6 +31,7 @@
#include <deque>
#include <string>
+#include <vector>
struct backtrace_map_t {
uintptr_t start = 0;
@@ -48,6 +49,8 @@ public:
// is unsupported.
static BacktraceMap* Create(pid_t pid, bool uncached = false);
+ static BacktraceMap* Create(pid_t pid, const std::vector<backtrace_map_t>& maps);
+
virtual ~BacktraceMap();
// Fill in the map data structure for the given address.