knurling-rs / probe-run

Run embedded programs just like native ones
Apache License 2.0
645 stars 75 forks source link

unwinding: do not read _all_ stacked registers #187

Closed japaric closed 3 years ago

japaric commented 3 years ago

to unwind pass exceptions we currently read all the registers stacked by the exception (up to 25 words): https://github.com/knurling-rs/probe-run/blob/e8be32a572285e2c004753e525a5ab22707a1006/src/stacked.rs#L5-L15

I believe however that we only need to retrieve the stacked LR and PC registers for the unwinding process so we could reduce the read memory operation to only fetch 7 words. Reading less memory may increase the chances of being able to unwind the stack in presence of a stack overflow (see PR #184 )