Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2739)

Unified Diff: base/debug_util_posix.cc

Issue 18173: "Port" StackTrace to Mac (Closed) Base URL: svn://chrome-svn.corp.google.com/chrome/trunk/src/
Patch Set: '' Created 11 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/debug_util.cc ('k') | base/debug_util_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/debug_util_posix.cc
===================================================================
--- base/debug_util_posix.cc (revision 8223)
+++ base/debug_util_posix.cc (working copy)
@@ -5,13 +5,9 @@
#include "build/build_config.h"
#include "base/debug_util.h"
-#if defined(OS_LINUX)
-#include <unistd.h>
agl 2009/01/16 22:02:47 unistd is needed for STDERR_FILENO
#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 @@
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 @@
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;
-}
« no previous file with comments | « base/debug_util.cc ('k') | base/debug_util_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698