SPRAC71B February 2019 – October 2023
Abstractly, all unwinding sequences take the following form:
Step 1: Restore SP
An actual epilog does not restore SP until after the callee-saved registers are restored, but because stack unwinding is a virtual operation, the simulated unwinding of TDEH may perform the SP restore first. This simplifies the restoration of the other callee-saved registers.
SP will be restored by incrementing by a constant. In addition to the explicit increment, the SP is implicitly incremented to account for the size of the callee-saved area.
Step 2: Restore Registers
Abstractly, the callee-saved registers are restored in register safe debug order (Section 4.6.2) starting with the location pointed to by (the old) SP and moving to lower addresses.
Step 3: Return
Every unwinding sequence ends with an implicit or explicit "RET ", which indicates that unwinding is complete for the current frame.