From f9b3d6e493c1b6ab3dbdab71c5f8fa849db4abaf Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 20 Feb 2020 19:36:24 -0800 Subject: Add RISCV support to GetProgramCounter() (#621) Identify PC register from signal context Signed-off-by: Khem Raj --- absl/debugging/internal/examine_stack.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'absl') diff --git a/absl/debugging/internal/examine_stack.cc b/absl/debugging/internal/examine_stack.cc index 22f41b4..a3dd893 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(context->uc_mcontext.gp_regs[32]); #elif defined(__powerpc__) return reinterpret_cast(context->uc_mcontext.regs->nip); +#elif defined(__riscv) + return reinterpret_cast(context->uc_mcontext.__gregs[REG_PC]); #elif defined(__s390__) && !defined(__s390x__) return reinterpret_cast(context->uc_mcontext.psw.addr & 0x7fffffff); #elif defined(__s390__) && defined(__s390x__) -- cgit v1.2.3