llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

Fix swift async frames unwinding unwinding

Open felipepiovezan opened this issue 6 months ago • 1 comments

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

felipepiovezan avatar Jul 29 '24 21:07 felipepiovezan