summaryrefslogtreecommitdiffstats
path: root/libbacktrace/BacktraceMap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libbacktrace/BacktraceMap.cpp')
-rw-r--r--libbacktrace/BacktraceMap.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/libbacktrace/BacktraceMap.cpp b/libbacktrace/BacktraceMap.cpp
index 78f5b6b..6320800 100644
--- a/libbacktrace/BacktraceMap.cpp
+++ b/libbacktrace/BacktraceMap.cpp
@@ -21,9 +21,13 @@
#include <string>
#include <vector>
+#include <backtrace/backtrace_constants.h>
#include <backtrace/BacktraceMap.h>
#include <log/log.h>
+#include "thread_utils.h"
+#include "BacktraceImpl.h"
+
BacktraceMap::BacktraceMap(pid_t pid) : pid_(pid) {
if (pid_ < 0) {
pid_ = getpid();
@@ -128,3 +132,16 @@ bool BacktraceMap::Build() {
return true;
}
+
+#if defined(__APPLE__)
+// Corkscrew and libunwind don't compile on the mac, so create a generic
+// map object.
+BacktraceMap* BacktraceMap::Create(pid_t pid) {
+ BacktraceMap* map = new BacktraceMap(pid);
+ if (!map->Build()) {
+ delete map;
+ return NULL;
+ }
+ return map;
+}
+#endif