NOTES 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. - the frame state consists of the following:
  2. - ip current instruction pointer
  3. - sp current stack pointer value
  4. - bsp current backing store pointer
  5. - cfm current frame mask
  6. these are derived from the next younger (more deeply nested) frame
  7. as follows:
  8. - ip == saved return-link (may be b0 or an alternate branch-reg)
  9. - sp == if younger frame has a fixed-sized frame, sp + size-of-frame,
  10. else saved sp
  11. - cfm == saved ar.pfs
  12. - bsp == if ar.bsp has been saved, saved ar.bsp, otherwise,
  13. ar.bsp \ominus saved ar.pfs.pfm.sol
  14. The unwind cursor should represent the machine state as it existed at
  15. the address contained in register ip. This state consists of the
  16. *current* frame state and the save locations in the next younger
  17. frame.
  18. An unwind script current takes the old save locations and updates them
  19. for the next older frame. With the new setup, we need to update the
  20. frame state first, without updating the other save locations. For this
  21. to work, we need the following info:
  22. - save location of return-link
  23. - save location of ar.pfs
  24. - save location of bsp (if it has been saved)
  25. - size of stack frame (fixed case) or save location of sp
  26. setup:
  27. func: ...
  28. ...
  29. ...
  30. br.call foo <-- call site
  31. ... <-- ip
  32. ...
  33. initial state:
  34. The unwind cursor represents the (preserved) machine state
  35. as it existed at "ip".
  36. Evaluating the unwind descriptors for "ip" yields the following
  37. info:
  38. - frame size at call site (or previous sp)
  39. - what registers where saved where by func before
  40. the call site was reached
  41. Note that there is some procedure info that needs to be obtained
  42. for the new "ip" which is contained in the unwind descriptors.
  43. Specifically, the following is needed:
  44. - procedure's start address
  45. - personality address
  46. - pointer to language-specific data area
  47. This info is stored in a separate proc_info structure and needs
  48. to be obtained right after running the unwind script for func.