about summary refs log tree commit diff
path: root/absl
diff options
context:
space:
mode:
Diffstat (limited to 'absl')
-rw-r--r--absl/debugging/internal/examine_stack.cc2
-rw-r--r--absl/debugging/internal/stacktrace_x86-inl.inc4
2 files changed, 6 insertions, 0 deletions
diff --git a/absl/debugging/internal/examine_stack.cc b/absl/debugging/internal/examine_stack.cc
index 22f41b46ee2e..a3dd893a9dfe 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__)
diff --git a/absl/debugging/internal/stacktrace_x86-inl.inc b/absl/debugging/internal/stacktrace_x86-inl.inc
index 972febdd6fb9..f87cafb6c866 100644
--- a/absl/debugging/internal/stacktrace_x86-inl.inc
+++ b/absl/debugging/internal/stacktrace_x86-inl.inc
@@ -173,6 +173,7 @@ static void **NextStackFrame(void **old_fp, const void *uc) {
     static const unsigned char *kernel_rt_sigreturn_address = nullptr;
     static const unsigned char *kernel_vsyscall_address = nullptr;
     if (num_push_instructions == -1) {
+#ifdef ABSL_HAVE_VDSO_SUPPORT
       absl::debugging_internal::VDSOSupport vdso;
       if (vdso.IsPresent()) {
         absl::debugging_internal::VDSOSupport::SymbolInfo
@@ -201,6 +202,9 @@ static void **NextStackFrame(void **old_fp, const void *uc) {
       } else {
         num_push_instructions = 0;
       }
+#else
+      num_push_instructions = 0;
+#endif
     }
     if (num_push_instructions != 0 && kernel_rt_sigreturn_address != nullptr &&
         old_fp[1] == kernel_rt_sigreturn_address) {