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

Unified Diff: src/base/debug/stack_trace_posix.cc

Issue 2324453002: AIX: Disable backtrace API call (Closed)
Patch Set: Addressed comments Created 4 years, 3 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 | src/v8.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/base/debug/stack_trace_posix.cc
diff --git a/src/base/debug/stack_trace_posix.cc b/src/base/debug/stack_trace_posix.cc
index cbd722d35cda9e12a33898c912f4da4794148599..be29a0d6863ec1b3cbeabb9b25ec195c77c2a0e9 100644
--- a/src/base/debug/stack_trace_posix.cc
+++ b/src/base/debug/stack_trace_posix.cc
@@ -135,6 +135,7 @@ void OutputPointer(void* pointer, BacktraceOutputHandler* handler) {
handler->HandleOutput(buf);
}
+#if !V8_OS_AIX
void ProcessBacktrace(void* const* trace, size_t size,
BacktraceOutputHandler* handler) {
// NOTE: This code MUST be async-signal safe (it's used by in-process
@@ -171,6 +172,7 @@ void ProcessBacktrace(void* const* trace, size_t size,
}
}
}
+#endif // !V8_OS_AIX
void PrintToStderr(const char* output) {
// NOTE: This code MUST be async-signal safe (it's used by in-process
@@ -359,23 +361,31 @@ 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 !V8_OS_AIX
// Though the backtrace API man page does not list any possible negative
// return values, we take no chance.
count_ = static_cast<size_t>(backtrace(trace_, arraysize(trace_)));
+#else
+ count_ = 0;
+#endif
}
void StackTrace::Print() const {
// 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 !V8_OS_AIX
PrintBacktraceOutputHandler handler;
ProcessBacktrace(trace_, count_, &handler);
+#endif
}
+#if !V8_OS_AIX
void StackTrace::OutputToStream(std::ostream* os) const {
StreamBacktraceOutputHandler handler(os);
ProcessBacktrace(trace_, count_, &handler);
}
+#endif
namespace internal {
« no previous file with comments | « no previous file | src/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698