[libunwind] [libunwind] Unwind through AArch64 FreeBSD signal trampolines (PR #235065)
via cfe-commits
cfe-commits at lists.llvm.org
Sat Oct 24 14:31:07 PDT 2026
================
@@ -3329,6 +3344,65 @@ int UnwindCursor<A, R>::stepThroughSigReturn(Registers_s390x &) {
#endif // defined(_LIBUNWIND_CHECK_LINUX_SIGRETURN) &&
// defined(_LIBUNWIND_TARGET_S390X)
+#if defined(_LIBUNWIND_CHECK_FREEBSD_SIGRETURN)
+template <typename A, typename R>
+bool UnwindCursor<A, R>::setInfoForSigReturn() {
+ // Ask the kernel rather than reading instructions at a possibly invalid PC.
+ // This is only used when no unwind information was found. Keep the result
+ // local to avoid shared mutable state when unwinding from a signal handler.
+ struct kinfo_sigtramp kst = {};
+ size_t len = sizeof(kst);
+ int mib[] = {CTL_KERN, KERN_PROC, KERN_PROC_SIGTRAMP, getpid()};
+ const int savedErrno = errno;
----------------
aokblast wrote:
For what reason we save and restore errno? I think it is unnecessary.
https://github.com/llvm/llvm-project/pull/235065
More information about the cfe-commits
mailing list