Skip to content

Commit

Permalink
Add RISCV support to GetProgramCounter() (#621)
Browse files Browse the repository at this point in the history
Identify PC register from signal context

Signed-off-by: Khem Raj <raj.khem@gmail.com>
  • Loading branch information
kraj committed Feb 21, 2020
1 parent 0232c87 commit f9b3d6e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions absl/debugging/internal/examine_stack.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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__)
Expand Down

0 comments on commit f9b3d6e

Please sign in to comment.