-
Notifications
You must be signed in to change notification settings - Fork 84
Fix unwinding through Reset
#337
Fix unwinding through Reset
#337
Conversation
r? @therealprof (rust-highfive has picked a reviewer for you, use r? to override) |
@@ -94,6 +94,10 @@ Reset: | |||
#endif | |||
|
|||
4: | |||
.cfi_def_cfa sp, 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be worth an explanation, as it's not something you often come across in ARM asm.
Maybe link to https://sourceware.org/binutils/docs/as/CFI-directives.html, or include their note:
.cfi_def_cfa
defines a rule for computing CFA as: take address from register and add offset to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a comment and link
Can confirm it resolves the upstream issue though:
|
bors r+ |
🔒 Permission denied Existing reviewers: click here to make jonathanpallant a reviewer |
Ugh. Wearing the wrong hat. |
bors r+ |
^ have switched hats |
Unwinders may detect the end of the program by seeing
0xFFFFFFFF
inlr
, which is why code to ensure that it has that value was added in #293. However, thebl main
overwrites that value with the current program counter. This PR saves the oldlr
value on the stack, and adds debuginfo entries to allow an external unwinder to restore the value.This fixes knurling-rs/probe-run#277