Created
May 2, 2013 08:54
-
-
Save yellowback/5501027 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: debug/stack_trace_posix.cc | |
=================================================================== | |
--- debug/stack_trace_posix.cc (revision 161115) | |
+++ debug/stack_trace_posix.cc (working copy) | |
@@ -124,7 +124,7 @@ | |
trace_strings->push_back(base::StringPrintf("%p", trace[i])); | |
} | |
} | |
-#else | |
+#elif defined(OS_LINUX) | |
scoped_ptr_malloc<char*> trace_symbols(backtrace_symbols(trace, size)); | |
if (trace_symbols.get()) { | |
for (int i = 0; i < size; ++i) { | |
@@ -150,7 +150,11 @@ | |
StackTrace::StackTrace() { | |
// Though the backtrace API man page does not list any possible negative | |
// return values, we take no chance. | |
+#if defined(OS_LINUX) | |
count_ = std::max(backtrace(trace_, arraysize(trace_)), 0); | |
+#else | |
+ count_ = 0; | |
+#endif | |
} | |
void StackTrace::PrintBacktrace() const { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment