diff options
author | Khem Raj <raj.khem@gmail.com> | 2020-02-20 19:36:24 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-20 22:36:23 -0500 |
commit | f9b3d6e493c1b6ab3dbdab71c5f8fa849db4abaf (patch) | |
tree | 6960ae77f0e3150c2caa77c98b64157d1769ef5a | |
parent | 0232c87f21c26718aa3eb2d86678070f3b498a4e (diff) |
Add RISCV support to GetProgramCounter() (#621)
Identify PC register from signal context
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r-- | absl/debugging/internal/examine_stack.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/absl/debugging/internal/examine_stack.cc b/absl/debugging/internal/examine_stack.cc index 22f41b46..a3dd893a 100644 --- a/absl/debugging/internal/examine_stack.cc +++ b/absl/debugging/internal/examine_stack.cc @@ -53,6 +53,8 @@ void* GetProgramCounter(void* vuc) { return reinterpret_cast<void*>(context->uc_mcontext.gp_regs[32]); #elif defined(__powerpc__) return reinterpret_cast<void*>(context->uc_mcontext.regs->nip); +#elif defined(__riscv) + return reinterpret_cast<void*>(context->uc_mcontext.__gregs[REG_PC]); #elif defined(__s390__) && !defined(__s390x__) return reinterpret_cast<void*>(context->uc_mcontext.psw.addr & 0x7fffffff); #elif defined(__s390__) && defined(__s390x__) |