llvm-project
llvm-project copied to clipboard
Fix swift async frames unwinding unwinding
This series of patches aims to solve the problem where LLDB is unable to print variables in backtraces involving swift async functions. The only frame where this works today is the first async frame, which is a real frame and is physically on the stack. We fail to do so for all virtual frames.
The underlying problem is simple: when unwinding the PC, we use the first instruction of the continuation funclets. This instruction is part of the prologue, where no variables are in scope.
The solution is similarly simple: we just offset the PC by the size of the prologue of the continuation funclet.
These commits are meant to be reviewed independently, please the commit messages too.
The first commit is a cherry-pick from: https://github.com/llvm/llvm-project/pull/100624