Commit 1086e02f authored by bmeurer@chromium.org's avatar bmeurer@chromium.org

openbsd: fix platform build

R=bmeurer@chromium.org

Review URL: https://codereview.chromium.org/21705003

Patch from Ben Noordhuis <info@bnoordhuis.nl>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16122 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent ab066fae
......@@ -38,7 +38,10 @@
#include <signal.h>
#include <sys/time.h>
#include <sys/syscall.h>
#if !defined(__ANDROID__) || defined(__BIONIC_HAVE_UCONTEXT_T)
// OpenBSD doesn't have <ucontext.h>. ucontext_t lives in <signal.h>
// and is a typedef for struct sigcontext. There is no uc_mcontext.
#if (!defined(__ANDROID__) || defined(__BIONIC_HAVE_UCONTEXT_T)) \
&& !defined(__OpenBSD__)
#include <ucontext.h>
#endif
#include <unistd.h>
......@@ -330,7 +333,9 @@ void SignalHandler::HandleProfilerSignal(int signal, siginfo_t* info,
#else
// Extracting the sample from the context is extremely machine dependent.
ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(context);
#if !defined(__OpenBSD__)
mcontext_t& mcontext = ucontext->uc_mcontext;
#endif
#if defined(__linux__) || defined(__ANDROID__)
#if V8_HOST_ARCH_IA32
state.pc = reinterpret_cast<Address>(mcontext.gregs[REG_EIP]);
......@@ -384,7 +389,6 @@ void SignalHandler::HandleProfilerSignal(int signal, siginfo_t* info,
state.fp = reinterpret_cast<Address>(mcontext.__gregs[_REG_RBP]);
#endif // V8_HOST_ARCH_*
#elif defined(__OpenBSD__)
USE(mcontext);
#if V8_HOST_ARCH_IA32
state.pc = reinterpret_cast<Address>(ucontext->sc_eip);
state.sp = reinterpret_cast<Address>(ucontext->sc_esp);
......
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