diff --git a/deps/v8/src/sampler.cc b/deps/v8/src/sampler.cc index d72ed1acdb8..6e451f0bdea 100644 --- a/deps/v8/src/sampler.cc +++ b/deps/v8/src/sampler.cc @@ -38,7 +38,10 @@ #include #include #include -#if !defined(__ANDROID__) || defined(__BIONIC_HAVE_UCONTEXT_T) +// OpenBSD doesn't have . ucontext_t lives in +// and is a typedef for struct sigcontext. There is no uc_mcontext. +#if (!defined(__ANDROID__) || defined(__BIONIC_HAVE_UCONTEXT_T)) \ + && !defined(__OpenBSD__) #include #endif #include @@ -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(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
(mcontext.gregs[REG_EIP]); @@ -384,7 +389,6 @@ void SignalHandler::HandleProfilerSignal(int signal, siginfo_t* info, state.fp = reinterpret_cast
(mcontext.__gregs[_REG_RBP]); #endif // V8_HOST_ARCH_* #elif defined(__OpenBSD__) - USE(mcontext); #if V8_HOST_ARCH_IA32 state.pc = reinterpret_cast
(ucontext->sc_eip); state.sp = reinterpret_cast
(ucontext->sc_esp);