Skip to content

fix(mac): use arm64 thread state accessors on new Apple SDKs#45

Open
zhaowq32 wants to merge 1 commit into
getsentry:handlerfrom
zhaowq32:handler
Open

fix(mac): use arm64 thread state accessors on new Apple SDKs#45
zhaowq32 wants to merge 1 commit into
getsentry:handlerfrom
zhaowq32:handler

Conversation

@zhaowq32
Copy link
Copy Markdown

Summary

Newer Apple SDKs expose __darwin_arm_thread_state64 through accessor macros instead of allowing direct access to fields such as __fp, __lr, __sp, and __pc.

This change updates Breakpad's macOS arm64 context population code to prefer the official SDK accessors when available, while preserving the existing field-based code path for older SDKs.

Problem

With newer Xcode / macOS SDKs, Breakpad fails to compile in src/client/mac/handler/minidump_generator.cc with errors like:

error: no member named '__fp' in '__darwin_arm_thread_state64'

This breaks downstream consumers that vendor Breakpad, including macOS arm64/arm64e builds.

Fix

Use feature-based compatibility logic instead of SDK version checks:

  • If the SDK provides:

    • __darwin_arm_thread_state64_set_fp
    • __darwin_arm_thread_state64_set_lr_fptr
    • __darwin_arm_thread_state64_set_sp
    • __darwin_arm_thread_state64_set_pc_fptr

    then use those official accessors.

  • Otherwise, fall back to the existing direct field assignments for older SDKs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant