apple / llvm-project

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.
https://llvm.org
Other
1.1k stars 320 forks source link

[lldb][swift] Fix zeroth frame detection in async functions #8828

Closed felipepiovezan closed 1 month ago

felipepiovezan commented 1 month ago

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)

felipepiovezan commented 1 month ago

@swift-ci test

felipepiovezan commented 1 month ago

(PR from next == https://github.com/apple/llvm-project/pull/8827)

felipepiovezan commented 1 month ago

@swift-ci test platform windows

felipepiovezan commented 1 month ago

@swift-ci test windows platform