Commit bc752a09 authored by bjaideep's avatar bjaideep Committed by Commit bot

AIX: Disable backtrace API call

Backtrace() and backtrace_symbols() API are not supported on
AIX and there are no user-mode equivalent API for the same.
For now, disabling the call to those API.
Currently this is preventing V8 to build on AIX.
This debug functionality was added in
https://codereview.chromium.org/2248393002

R=rmcilroy@chromium.org

BUG=
LOG=N

Review-Url: https://codereview.chromium.org/2324453002
Cr-Commit-Position: refs/heads/master@{#39356}
parent 87c4a7c8
......@@ -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 {
......
......@@ -1979,6 +1979,7 @@
],
['OS=="aix"', {
'sources': [
'base/debug/stack_trace_posix.cc',
'base/platform/platform-aix.cc',
'base/platform/platform-posix.cc'
]},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment