| - the frame state consists of the following: |
| |
| - ip current instruction pointer |
| - sp current stack pointer value |
| - bsp current backing store pointer |
| - cfm current frame mask |
| |
| these are derived from the next younger (more deeply nested) frame |
| as follows: |
| |
| - ip == saved return-link (may be b0 or an alternate branch-reg) |
| - sp == if younger frame has a fixed-sized frame, sp + size-of-frame, |
| else saved sp |
| - cfm == saved ar.pfs |
| - bsp == if ar.bsp has been saved, saved ar.bsp, otherwise, |
| ar.bsp \ominus saved ar.pfs.pfm.sol |
| |
| The unwind cursor should represent the machine state as it existed at |
| the address contained in register ip. This state consists of the |
| *current* frame state and the save locations in the next younger |
| frame. |
| |
| An unwind script current takes the old save locations and updates them |
| for the next older frame. With the new setup, we need to update the |
| frame state first, without updating the other save locations. For this |
| to work, we need the following info: |
| |
| - save location of return-link |
| - save location of ar.pfs |
| - save location of bsp (if it has been saved) |
| - size of stack frame (fixed case) or save location of sp |
| |
| |
| setup: |
| |
| func: ... |
| ... |
| ... |
| br.call foo <-- call site |
| ... <-- ip |
| ... |
| |
| initial state: |
| |
| The unwind cursor represents the (preserved) machine state |
| as it existed at "ip". |
| |
| Evaluating the unwind descriptors for "ip" yields the following |
| info: |
| |
| - frame size at call site (or previous sp) |
| - what registers where saved where by func before |
| the call site was reached |
| |
| |
| Note that there is some procedure info that needs to be obtained |
| for the new "ip" which is contained in the unwind descriptors. |
| Specifically, the following is needed: |
| |
| - procedure's start address |
| - personality address |
| - pointer to language-specific data area |
| |
| This info is stored in a separate proc_info structure and needs |
| to be obtained right after running the unwind script for func. |