From 8da32be6f0b97d79499f9da24ce8849819180751 Mon Sep 17 00:00:00 2001 From: barracuda156 Date: Mon, 6 Nov 2023 00:22:23 +0800 Subject: [PATCH] libsampler: support powerpc-darwin --- deps/v8/src/libsampler/sampler.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/deps/v8/src/libsampler/sampler.cc b/deps/v8/src/libsampler/sampler.cc index 03a9f6034d0bff..d14da3081c6e5d 100644 --- a/deps/v8/src/libsampler/sampler.cc +++ b/deps/v8/src/libsampler/sampler.cc @@ -468,7 +468,12 @@ void SignalHandler::FillRegisterState(void* context, RegisterState* state) { state->pc = reinterpret_cast(mcontext->__ss.__eip); state->sp = reinterpret_cast(mcontext->__ss.__esp); state->fp = reinterpret_cast(mcontext->__ss.__ebp); -#endif // V8_HOST_ARCH_IA32 +#elif V8_HOST_ARCH_PPC || V8_HOST_ARCH_PPC64 + state->pc = reinterpret_cast(mcontext->__ss.__srr0); + state->sp = reinterpret_cast(mcontext->__ss.__r1); + state->fp = reinterpret_cast(mcontext->__ss.__r30); + state->lr = reinterpret_cast(mcontext->__ss.__lr); +#endif // V8_HOST_ARCH_* #elif V8_OS_FREEBSD #if V8_HOST_ARCH_IA32 state->pc = reinterpret_cast(mcontext.mc_eip);