Skip to content

Commit

Permalink
dont use backtrace_from_fp on ios
Browse files Browse the repository at this point in the history
  • Loading branch information
Swatinem committed Apr 21, 2021
1 parent 6745582 commit 9b50fe9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/unwinder/sentry_unwinder_libbacktrace.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "sentry_boot.h"

#if defined(SENTRY_PLATFORM_MACOS) || defined(__GLIBC__)
#if defined(SENTRY_PLATFORM_DARWIN) || defined(__GLIBC__)
# include <execinfo.h>
#endif

Expand All @@ -9,7 +9,8 @@ sentry__unwind_stack_libbacktrace(
void *addr, const sentry_ucontext_t *uctx, void **ptrs, size_t max_frames)
{
if (addr) {
#if defined(MAC_OS_X_VERSION_10_14) && __has_builtin(__builtin_available)
#if defined(SENTRY_PLATFORM_MACOS) && defined(MAC_OS_X_VERSION_10_14) \
&& __has_builtin(__builtin_available)
if (__builtin_available(macOS 10.14, *)) {
return (size_t)backtrace_from_fp(addr, ptrs, (int)max_frames);
}
Expand All @@ -18,7 +19,7 @@ sentry__unwind_stack_libbacktrace(
} else if (uctx) {
return 0;
}
#if defined(SENTRY_PLATFORM_MACOS) || defined(__GLIBC__)
#if defined(SENTRY_PLATFORM_DARWIN) || defined(__GLIBC__)
return (size_t)backtrace(ptrs, (int)max_frames);
#else
(void)ptrs;
Expand Down

0 comments on commit 9b50fe9

Please sign in to comment.