-
-
Notifications
You must be signed in to change notification settings - Fork 74
Unwinding with -C force-frame-pointers=off #387
Description
This came up in the review of #383:
probe-run/src/backtrace/unwind.rs
Lines 104 to 110 in b83bb96
| // If the frame didn't move, and the program counter didn't change, bail out | |
| // (otherwise we might print the same frame over and over). | |
| if !cfa_changed && !program_counter_changed { | |
| // If we do not end up in the reset function the stack is corrupted | |
| output.corrupted = !reset_range.contains(&pc); | |
| break; | |
| } |
this is not due to this PR but I wouldn't necessarily categorize this exit condition as "corrupted". if you compile the rust program with
-C force-frame-pointers=offthen it's not possible to unwind the stack because frame pointer information is missing (from register r7) so you'll hit this branch but the call stack and the program will both operate fine.
-C force-frame-pointers=offis not very common but the assembly trampolines used to implement context switches in RTOSes / kernels could have the same effect of making unwinding not work.I think it would be more to correct to simply say in this branch that it's "not possible to further unwind the stack" or something like that