Skip to content

Fix handling for RegisterRule::Undefined#52

Merged
nbdd0121 merged 1 commit intonbdd0121:trunkfrom
philipc:undefined
Jan 13, 2026
Merged

Fix handling for RegisterRule::Undefined#52
nbdd0121 merged 1 commit intonbdd0121:trunkfrom
philipc:undefined

Conversation

@philipc
Copy link
Contributor

@philipc philipc commented Jan 12, 2026

gimli::UnwindTableRow::registers currently never returns RegisterRule::Undefined so this didn't matter. However, a future gimli release will change this behaviour. In particular, this fix is required to handle a DW_CFA_undefined rule for RA.

gimli-rs/gimli#859 is the planned change.

Copy link
Owner

@nbdd0121 nbdd0121 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! I thought undefined values don't matter, but apparently RA is special as dwarf defines RA rule being undefined to mean unwind complete.

Perhaps add a comment explaining this? Something like "For most registers, undefined indicates the value does not need to be preserved so the value content does not matter. However when RA is undefined it indicates that the unwinding is complete."

`gimli::UnwindTableRow::registers` currently never returns
`RegisterRule::Undefined` so this didn't matter. However, a future
gimli release will change this behaviour. In particular, this fix is
required to handle a `DW_CFA_undefined` rule for `RA`.
@philipc
Copy link
Contributor Author

philipc commented Jan 12, 2026

Done. RA is the only special case I saw in the DWARF spec, but the two other unwind implementations I looked at handle undefined by setting to 0.

@nbdd0121 nbdd0121 merged commit 638ed58 into nbdd0121:trunk Jan 13, 2026
5 checks passed
@nbdd0121
Copy link
Owner

Thank you!

@philipc philipc deleted the undefined branch January 13, 2026 02:29
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