Closed jonas-schievink closed 2 years ago
r? @therealprof
(rust-highfive has picked a reviewer for you, use r? to override)
Can confirm it resolves the upstream issue though:
PS C:\Users\Test\Documents\knurling\app-template> cargo run --bin hello
Blocking waiting for file lock on build directory
Compiling cortex-m-rt v0.7.0 (https://github.com/knurling-rs/cortex-m-rt.git?branch=fix-unwind-through-reset#9c88eab9)
Compiling stm32f4xx-hal v0.10.1
Compiling my_project v0.1.0 (C:\Users\Test\Documents\knurling\app-template)
Finished dev [optimized + debuginfo] target(s) in 15.88s
Running `probe-run --chip STM32F429ZITx target\thumbv7em-none-eabi\debug\hello`
(HOST) INFO flashing program (7.93 KiB)
(HOST) INFO success!
────────────────────────────────────────────────────────────────────────────────
Hello, world!
└─ hello::__cortex_m_rt_main @ src\bin\hello.rs:8
────────────────────────────────────────────────────────────────────────────────
(HOST) INFO device halted without error
bors r+
:lock: 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 https://github.com/rust-embedded/cortex-m-rt/pull/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 https://github.com/knurling-rs/probe-run/issues/277