Add support for sparc and sparc64 (#899)

Fixes #893
pull/904/head
John Paul Adrian Glaubitz 4 years ago committed by GitHub
parent 7055876380
commit 3fcd00d7dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      absl/base/internal/direct_mmap.h
  2. 4
      absl/debugging/internal/examine_stack.cc

@ -77,7 +77,8 @@ inline void* DirectMmap(void* start, size_t length, int prot, int flags, int fd,
(defined(__mips__) && _MIPS_SIM == _MIPS_SIM_ABI32) || \
(defined(__PPC__) && !defined(__PPC64__)) || \
(defined(__riscv) && __riscv_xlen == 32) || \
(defined(__s390__) && !defined(__s390x__))
(defined(__s390__) && !defined(__s390x__)) || \
(defined(__sparc__) && !defined(__arch64__))
// On these architectures, implement mmap with mmap2.
static int pagesize = 0;
if (pagesize == 0) {

@ -63,6 +63,10 @@ void* GetProgramCounter(void* vuc) {
return reinterpret_cast<void*>(context->uc_mcontext.psw.addr & 0x7fffffff);
#elif defined(__s390__) && defined(__s390x__)
return reinterpret_cast<void*>(context->uc_mcontext.psw.addr);
#elif defined(__sparc__) && !defined(__arch64__)
return reinterpret_cast<void*>(context->uc_mcontext.gregs[19]);
#elif defined(__sparc__) && defined(__arch64__)
return reinterpret_cast<void*>(context->uc_mcontext.mc_gregs[19]);
#elif defined(__x86_64__)
if (16 < ABSL_ARRAYSIZE(context->uc_mcontext.gregs))
return reinterpret_cast<void*>(context->uc_mcontext.gregs[16]);

Loading…
Cancel
Save