[all-commits] [llvm/llvm-project] 45d151: [libunwind][AIX] Fix problem with stepping up from...
xingxue-ibm via All-commits
all-commits at lists.llvm.org
Mon Oct 16 09:25:22 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 45d151138008c4880c8f9b77ffc43c23e0a9f1cb
https://github.com/llvm/llvm-project/commit/45d151138008c4880c8f9b77ffc43c23e0a9f1cb
Author: Xing Xue <xingxue at outlook.com>
Date: 2023-10-16 (Mon, 16 Oct 2023)
Changed paths:
M libunwind/src/Registers.hpp
M libunwind/src/UnwindCursor.hpp
M libunwind/src/UnwindRegistersSave.S
A libunwind/test/aix_signal_unwind.pass.sh.S
Log Message:
-----------
[libunwind][AIX] Fix problem with stepping up from a leaf function when unwinding started in a signal handler
Summary:
The implementation of AIX unwinder gets the return address from the link area of the stack frame of a function and uses the return address to walk up functions. However, when unwinding starts from a signal handler and the function that raised the signal happens to be a leaf function and it does not have its own stack frame, the return address of the stack frame of the leaf function points to the caller of the function that calls the leaf function because the leaf function and its caller share the same stack frame. As a result, the caller of the leaf function is skipped. This patch fixes the problem by saving the LR value in sigcontext when the unwinder hits the signal handler trampoline frame and using it as the return address of the leaf function. The LR value from sigcontext is saved in the unwinding context slot for LR currently unused.
Reviewed by: stephenpeckham
Differential Revision: https://reviews.llvm.org/D158655
More information about the All-commits
mailing list