[all-commits] [llvm/llvm-project] 9db254: [lldb][AArch64] Add UnwindPlan for Linux sigreturn

David Spickett via All-commits all-commits at lists.llvm.org
Thu Nov 11 03:32:19 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9db2541d4c30100d7ccc6cc9db717df102b302d9
      https://github.com/llvm/llvm-project/commit/9db2541d4c30100d7ccc6cc9db717df102b302d9
  Author: David Spickett <david.spickett at linaro.org>
  Date:   2021-11-11 (Thu, 11 Nov 2021)

  Changed paths:
    M lldb/include/lldb/Target/Platform.h
    M lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp
    M lldb/source/Plugins/Platform/Linux/PlatformLinux.h
    M lldb/source/Target/RegisterContextUnwind.cpp
    M lldb/test/API/functionalities/signal/handle-abrt/TestHandleAbort.py
    A lldb/test/API/linux/aarch64/unwind_signal/Makefile
    A lldb/test/API/linux/aarch64/unwind_signal/TestUnwindSignal.py
    A lldb/test/API/linux/aarch64/unwind_signal/main.c

  Log Message:
  -----------
  [lldb][AArch64] Add UnwindPlan for Linux sigreturn

This adds a specific unwind plan for AArch64 Linux sigreturn frames.
Previously we assumed that the fp would be valid here but it is not.

https://github.com/torvalds/linux/blob/master/arch/arm64/kernel/vdso/sigreturn.S

On Ubuntu Bionic it happened to point to an old frame info which meant
you got what looked like a correct backtrace. On Focal, the info is
completely invalid. (probably due to some code shuffling in libc)

This adds an UnwindPlan that knows that the sp in a sigreturn frame
points to an rt_sigframe from which we can offset to get saved
sp and pc values to backtrace correctly.

Based on LibUnwind's change: https://reviews.llvm.org/D90898

A new test is added that sets all compares the frames from the initial
signal catch to the handler break. Ensuring that the stack/frame pointer,
function name and register values match.
(this test is AArch64 Linux specific because it's the only one
with a specific unwind plan for this situation)

Fixes https://bugs.llvm.org/show_bug.cgi?id=52165

Reviewed By: omjavaid, labath

Differential Revision: https://reviews.llvm.org/D112069




More information about the All-commits mailing list