Index: src/platform-solaris.cc |
diff --git a/src/platform-solaris.cc b/src/platform-solaris.cc |
index df81c3a6bc87fc82042eb45138afeafe570f19d0..f082af125404693b71cf528d573c5bb63e2f8588 100644 |
--- a/src/platform-solaris.cc |
+++ b/src/platform-solaris.cc |
@@ -211,6 +211,20 @@ static int StackWalkCallback(uintptr_t pc, int signo, void* data) { |
} |
+int OS::StackWalk(Vector<OS::StackFrame> frames) { |
+ ucontext_t ctx; |
+ struct StackWalker walker = { frames, 0 }; |
+ |
+ if (getcontext(&ctx) < 0) return kStackWalkError; |
+ |
+ if (!walkcontext(&ctx, StackWalkCallback, &walker)) { |
+ return kStackWalkError; |
+ } |
+ |
+ return walker.index; |
+} |
+ |
+ |
// Constants used for mmap. |
static const int kMmapFd = -1; |
static const int kMmapFdOffset = 0; |