Skip to content

feat(native): add support for win arm64 unwind codes#978

Draft
klochek wants to merge 1 commit into
masterfrom
christopherklochek/win_arm64_unwind
Draft

feat(native): add support for win arm64 unwind codes#978
klochek wants to merge 1 commit into
masterfrom
christopherklochek/win_arm64_unwind

Conversation

@klochek
Copy link
Copy Markdown

@klochek klochek commented May 14, 2026

(Keeping as a draft for the moment; goblins hasn't pushed a new release w/ arm64 support yet.)

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 14, 2026

Fails
🚫 Please consider adding a changelog entry for the next release.
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

### Features

- add support for win arm64 unwind codes ([#978](https://github.com/getsentry/symbolic/pull/978))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description or adding a skip-changelog label.

Generated by 🚫 dangerJS against 614ab8b

@klochek klochek force-pushed the christopherklochek/win_arm64_unwind branch from 6d605d3 to 08f62b8 Compare May 15, 2026 13:30
@klochek klochek force-pushed the christopherklochek/win_arm64_unwind branch from 08f62b8 to 614ab8b Compare May 15, 2026 13:58
Copy link
Copy Markdown
Contributor

@loewenheim loewenheim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very impressive! I basically only have some stylistic nits.

Comment thread symbolic-cfi/src/lib.rs
writer: &'a mut dyn Write,
}

// The kinds of registers the can be saved for unwinding.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// The kinds of registers the can be saved for unwinding.
// The kinds of registers that can be saved for unwinding.

Comment thread symbolic-cfi/src/lib.rs
}
}

// Computes the memory location relative to CFI, offset above SP
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These could all be doc comments.

Suggested change
// Computes the memory location relative to CFI, offset above SP
/// Computes the memory location relative to CFI, offset above SP

Comment thread symbolic-cfi/src/lib.rs
Comment on lines +1331 to +1332
" .{typ}{first_reg}: .cfa {} + ^ .{typ}{second_reg}: .cfa {} + ^",
o1, o2
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
" .{typ}{first_reg}: .cfa {} + ^ .{typ}{second_reg}: .cfa {} + ^",
o1, o2
" .{typ}{first_reg}: .cfa {o1} + ^ .{typ}{second_reg}: .cfa {o2} + ^"

Comment thread symbolic-cfi/src/lib.rs
Comment on lines +1346 to +1347
" .x{reg}: .cfa {} + ^ .lr: .cfa {} + ^",
o1, o2
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
" .x{reg}: .cfa {} + ^ .lr: .cfa {} + ^",
o1, o2
" .x{reg}: .cfa {o1} + ^ .lr: .cfa {o2} + ^"

Comment thread symbolic-cfi/src/lib.rs
let second_reg = first_reg + 1;

self.last_reg_kind = typ;
self.last_reg_num = first_reg + 1;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self.last_reg_num = first_reg + 1;
self.last_reg_num = second_reg;

Comment thread symbolic-cfi/src/lib.rs
Comment on lines +1456 to +1457
if matches!(code.code, Arm64UnwindCode::End)
|| matches!(code.code, Arm64UnwindCode::EndC)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if matches!(code.code, Arm64UnwindCode::End)
|| matches!(code.code, Arm64UnwindCode::EndC)
if matches!(code.code, Arm64UnwindCode::End | Arm64UnwindCode::EndC)

Comment thread symbolic-cfi/src/lib.rs
function.function_length(),
);

for (instruction_num, code) in unwind_codes.iter().rev().enumerate() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reason for the rev? Are codes just generally returned in reverse order?

Comment thread symbolic-cfi/src/lib.rs
Comment on lines +1473 to +1483
Arm64UnwindCode::AllocSmall { size_bytes } => {
enc.alloc_stack(size_bytes)?;
}

Arm64UnwindCode::AllocMedium { size_bytes } => {
enc.alloc_stack(size_bytes)?;
}

Arm64UnwindCode::AllocLarge { size_bytes } => {
enc.alloc_stack(size_bytes)?;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could unify these arms:

Suggested change
Arm64UnwindCode::AllocSmall { size_bytes } => {
enc.alloc_stack(size_bytes)?;
}
Arm64UnwindCode::AllocMedium { size_bytes } => {
enc.alloc_stack(size_bytes)?;
}
Arm64UnwindCode::AllocLarge { size_bytes } => {
enc.alloc_stack(size_bytes)?;
}
Arm64UnwindCode::AllocSmall { size_bytes } | Arm64UnwindCode::AllocMedium { size_bytes } | Arm64UnwindCode::AllocLarge { size_bytes } => {
enc.alloc_stack(size_bytes)?;
}

Comment thread symbolic-cfi/src/lib.rs
first_reg,
offset_bytes,
} => {
// save pair <x(19+2*#X),lr> at [sp+#Z*8], offset <= 504
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to make sure (this applies to some of the other branches too): first_reg is already the number 19 + 2 *#X?

Comment thread symbolic-cfi/src/lib.rs
Comment on lines +1578 to +1590
if pair {
if preindexed {
enc.save_pre_indexed_pair(typ, reg, offset_bytes)?;
} else {
enc.save_indexed_pair(typ, reg, offset_bytes)?;
}
} else {
if preindexed {
enc.save_pre_indexed(typ, reg, offset_bytes)?;
} else {
enc.save_indexed(typ, reg, offset_bytes)?;
}
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could match on (pair, preindexed) here instead.

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.

2 participants