Fix uc_mcontext register access on 32-bit PowerPC (#898)

Fixes #894
pull/904/head
John Paul Adrian Glaubitz 4 years ago committed by GitHub
parent b315753c0b
commit 7055876380
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      absl/debugging/internal/examine_stack.cc
  2. 4
      absl/debugging/internal/stacktrace_powerpc-inl.inc

@ -56,7 +56,7 @@ void* GetProgramCounter(void* vuc) {
#elif defined(__powerpc64__)
return reinterpret_cast<void*>(context->uc_mcontext.gp_regs[32]);
#elif defined(__powerpc__)
return reinterpret_cast<void*>(context->uc_mcontext.regs->nip);
return reinterpret_cast<void*>(context->uc_mcontext.uc_regs->gregs[32]);
#elif defined(__riscv)
return reinterpret_cast<void*>(context->uc_mcontext.__gregs[REG_PC]);
#elif defined(__s390__) && !defined(__s390x__)

@ -131,7 +131,11 @@ static void **NextStackFrame(void **old_sp, const void *uc) {
const ucontext_t* signal_context =
reinterpret_cast<const ucontext_t*>(uc);
void **const sp_before_signal =
#if defined(__PPC64__)
reinterpret_cast<void**>(signal_context->uc_mcontext.gp_regs[PT_R1]);
#else
reinterpret_cast<void**>(signal_context->uc_mcontext.uc_regs->gregs[PT_R1]);
#endif
// Check that alleged sp before signal is nonnull and is reasonably
// aligned.
if (sp_before_signal != nullptr &&

Loading…
Cancel
Save