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

Unified Diff: base/debug/stack_trace_posix.cc

Issue 226623008: don't use glibc-specific execinfo.h on uclibc builds (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/debug/stack_trace_posix.cc
diff --git a/base/debug/stack_trace_posix.cc b/base/debug/stack_trace_posix.cc
index 2d63a242430785a57d14ba5beedab9133f91d00c..36fa0a13f8a85e514b588b1a888a6d9b33be139a 100644
--- a/base/debug/stack_trace_posix.cc
+++ b/base/debug/stack_trace_posix.cc
@@ -5,7 +5,6 @@
#include "base/debug/stack_trace.h"
#include <errno.h>
-#include <execinfo.h>
#include <fcntl.h>
#include <signal.h>
#include <stdio.h>
@@ -20,8 +19,9 @@
#include <string>
#include <vector>
-#if defined(__GLIBCXX__)
+#if defined(__GLIBCXX__) && !defined(__UCLIBC__)
#include <cxxabi.h>
+#include <execinfo.h>
#endif
#if defined(OS_MACOSX)
@@ -71,7 +71,7 @@ void DemangleSymbols(std::string* text) {
// Note: code in this function is NOT async-signal safe (std::string uses
// malloc internally).
-#if defined(__GLIBCXX__)
+#if defined(__GLIBCXX__) && !defined(__UCLIBC__)
std::string::size_type search_from = 0;
while (search_from < text->size()) {
@@ -108,7 +108,7 @@ void DemangleSymbols(std::string* text) {
}
}
-#endif // defined(__GLIBCXX__)
+#endif // defined(__GLIBCXX__) && !defined(__UCLIBC__)
}
#endif // !defined(USE_SYMBOLIZE)
@@ -167,7 +167,7 @@ void ProcessBacktrace(void *const *trace,
handler->HandleOutput("\n");
}
-#else
+#elif defined(__GLIBCXX__) && !defined(__UCLIBC__)
bool printed = false;
// Below part is async-signal unsafe (uses malloc), so execute it only
@@ -738,9 +738,11 @@ StackTrace::StackTrace() {
// NOTE: This code MUST be async-signal safe (it's used by in-process
// stack dumping signal handler). NO malloc or stdio is allowed here.
+#if defined(__GLIBCXX__) && !defined(__UCLIBC__)
// Though the backtrace API man page does not list any possible negative
// return values, we take no chance.
count_ = base::saturated_cast<size_t>(backtrace(trace_, arraysize(trace_)));
+#endif
}
void StackTrace::Print() const {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698