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) { ...@@ -135,6 +135,7 @@ void OutputPointer(void* pointer, BacktraceOutputHandler* handler) {
handler->HandleOutput(buf); handler->HandleOutput(buf);
} }
#if !V8_OS_AIX
void ProcessBacktrace(void* const* trace, size_t size, void ProcessBacktrace(void* const* trace, size_t size,
BacktraceOutputHandler* handler) { BacktraceOutputHandler* handler) {
// NOTE: This code MUST be async-signal safe (it's used by in-process // 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, ...@@ -171,6 +172,7 @@ void ProcessBacktrace(void* const* trace, size_t size,
} }
} }
} }
#endif // !V8_OS_AIX
void PrintToStderr(const char* output) { void PrintToStderr(const char* output) {
// NOTE: This code MUST be async-signal safe (it's used by in-process // NOTE: This code MUST be async-signal safe (it's used by in-process
...@@ -359,23 +361,31 @@ StackTrace::StackTrace() { ...@@ -359,23 +361,31 @@ StackTrace::StackTrace() {
// NOTE: This code MUST be async-signal safe (it's used by in-process // 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. // 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 // Though the backtrace API man page does not list any possible negative
// return values, we take no chance. // return values, we take no chance.
count_ = static_cast<size_t>(backtrace(trace_, arraysize(trace_))); count_ = static_cast<size_t>(backtrace(trace_, arraysize(trace_)));
#else
count_ = 0;
#endif
} }
void StackTrace::Print() const { void StackTrace::Print() const {
// NOTE: This code MUST be async-signal safe (it's used by in-process // 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. // stack dumping signal handler). NO malloc or stdio is allowed here.
#if !V8_OS_AIX
PrintBacktraceOutputHandler handler; PrintBacktraceOutputHandler handler;
ProcessBacktrace(trace_, count_, &handler); ProcessBacktrace(trace_, count_, &handler);
#endif
} }
#if !V8_OS_AIX
void StackTrace::OutputToStream(std::ostream* os) const { void StackTrace::OutputToStream(std::ostream* os) const {
StreamBacktraceOutputHandler handler(os); StreamBacktraceOutputHandler handler(os);
ProcessBacktrace(trace_, count_, &handler); ProcessBacktrace(trace_, count_, &handler);
} }
#endif
namespace internal { namespace internal {
......
...@@ -1979,6 +1979,7 @@ ...@@ -1979,6 +1979,7 @@
], ],
['OS=="aix"', { ['OS=="aix"', {
'sources': [ 'sources': [
'base/debug/stack_trace_posix.cc',
'base/platform/platform-aix.cc', 'base/platform/platform-aix.cc',
'base/platform/platform-posix.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