From 88856c7fbf15827973d6d0455891dbb952824ba4 Mon Sep 17 00:00:00 2001 From: Thom Chiovoloni Date: Fri, 24 Mar 2023 18:01:14 -0700 Subject: [PATCH 1/2] Add other apple targets to libunwind workaround --- src/backtrace/libunwind.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/backtrace/libunwind.rs b/src/backtrace/libunwind.rs index c319fe45..bda4f03f 100644 --- a/src/backtrace/libunwind.rs +++ b/src/backtrace/libunwind.rs @@ -66,7 +66,11 @@ impl Frame { // // Note the `skip_inner_frames.rs` test is skipped on macOS due to this // clause, and if this is fixed that test in theory can be run on macOS! - if cfg!(target_os = "macos") || cfg!(target_os = "ios") { + if cfg!(target_os = "macos") + || cfg!(target_os = "ios") + || cfg!(target_os = "tvos") + || cfg!(target_os = "watchos") + { self.ip() } else { unsafe { uw::_Unwind_FindEnclosingFunction(self.ip()) } From 6eb620aa43816b5ec27588a7e8ead74eb89a4fdb Mon Sep 17 00:00:00 2001 From: Thom Chiovoloni Date: Wed, 21 Jun 2023 21:25:24 -0700 Subject: [PATCH 2/2] use target_vendor as requested --- src/backtrace/libunwind.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/backtrace/libunwind.rs b/src/backtrace/libunwind.rs index bda4f03f..aefa8b09 100644 --- a/src/backtrace/libunwind.rs +++ b/src/backtrace/libunwind.rs @@ -66,11 +66,7 @@ impl Frame { // // Note the `skip_inner_frames.rs` test is skipped on macOS due to this // clause, and if this is fixed that test in theory can be run on macOS! - if cfg!(target_os = "macos") - || cfg!(target_os = "ios") - || cfg!(target_os = "tvos") - || cfg!(target_os = "watchos") - { + if cfg!(target_vendor = "apple") { self.ip() } else { unsafe { uw::_Unwind_FindEnclosingFunction(self.ip()) }