summaryrefslogtreecommitdiffstats
path: root/base/debug_util_posix.cc
diff options
context:
space:
mode:
Diffstat (limited to 'base/debug_util_posix.cc')
-rw-r--r--base/debug_util_posix.cc28
1 files changed, 2 insertions, 26 deletions
diff --git a/base/debug_util_posix.cc b/base/debug_util_posix.cc
index 5594737..3a25017 100644
--- a/base/debug_util_posix.cc
+++ b/base/debug_util_posix.cc
@@ -5,13 +5,9 @@
#include "build/build_config.h"
#include "base/debug_util.h"
-#if defined(OS_LINUX)
-#include <unistd.h>
#include <execinfo.h>
-#endif
-
-#include <stdio.h>
#include <fcntl.h>
+#include <stdio.h>
#include <sys/stat.h>
#include <sys/sysctl.h>
#include <sys/types.h>
@@ -98,10 +94,8 @@ void DebugUtil::BreakDebugger() {
asm ("int3");
}
-#if defined(OS_LINUX)
-
StackTrace::StackTrace() {
- static const unsigned kMaxCallers = 256;
+ static const int kMaxCallers = 256;
void* callers[kMaxCallers];
int count = backtrace(callers, kMaxCallers);
@@ -113,21 +107,3 @@ void StackTrace::PrintBacktrace() {
fflush(stderr);
backtrace_symbols_fd(&trace_[0], trace_.size(), STDERR_FILENO);
}
-
-#elif defined(OS_MACOSX)
-
-// TODO(port): complete this code
-StackTrace::StackTrace() { }
-
-void StackTrace::PrintBacktrace() {
- NOTIMPLEMENTED();
-}
-
-#endif // defined(OS_MACOSX)
-
-const void *const *StackTrace::Addresses(size_t* count) {
- *count = trace_.size();
- if (trace_.size())
- return &trace_[0];
- return NULL;
-}