[Lldb-commits] [PATCH] D112069: [lldb][AArch64] Add UnwindPlan for Linux sigreturn

David Spickett via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Oct 19 06:11:33 PDT 2021


DavidSpickett created this revision.
Herald added subscribers: kristof.beyls, mgorny.
DavidSpickett requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

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

This also updates TestHandleAbort to check that common frames
between signal and signal handler backtrace are in fact the same.

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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D112069

Files:
  lldb/include/lldb/Symbol/AArch64UnwindInfo.h
  lldb/source/Symbol/AArch64UnwindInfo.cpp
  lldb/source/Symbol/CMakeLists.txt
  lldb/source/Target/RegisterContextUnwind.cpp
  lldb/test/API/functionalities/signal/handle-abrt/TestHandleAbort.py

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112069.380668.patch
Type: text/x-patch
Size: 7341 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20211019/770180ac/attachment-0001.bin>


More information about the lldb-commits mailing list