The LLVM Project is a collection of modular and reusable compiler and toolchain technologies. This fork is used to manage Apple’s stable releases of Clang as well as support the Swift project.
In all frames except for the zero-th frame, we subtract one from the address before looking up line number information. This is to account for the fact that such address is normally the return address of a call.
In async backtraces (async function awaiting another async function), however, we don't do that: this address is usually the continuation address, which is in a different low level function, even though it's "the same" source level function.
The current implementation was also applying this behavior (of not subtracting one) to async functions calling a synchronous function. To fix this, we remove the hardcoded "behaves like zeroth frame" from the thread plan responsible for this type of unwinding.
rdar://128679048
(cherry picked from commit 44413cf594e39f3d016c665bca4421bd85bad27d)
In all frames except for the zero-th frame, we subtract one from the address before looking up line number information. This is to account for the fact that such address is normally the return address of a call.
In async backtraces (async function awaiting another async function), however, we don't do that: this address is usually the continuation address, which is in a different low level function, even though it's "the same" source level function.
The current implementation was also applying this behavior (of not subtracting one) to async functions calling a synchronous function. To fix this, we remove the hardcoded "behaves like zeroth frame" from the thread plan responsible for this type of unwinding.
rdar://128679048 (cherry picked from commit 44413cf594e39f3d016c665bca4421bd85bad27d)