[Lldb-commits] [PATCH] D99944: [LLDB] AArch64 PAC elf-core stack unwinder support

Muhammad Omair Javaid via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Apr 6 04:32:37 PDT 2021


omjavaid created this revision.
omjavaid added reviewers: labath, justincohen, jasonmolenda, DavidSpickett.
Herald added subscribers: danielkiss, kristof.beyls.
omjavaid requested review of this revision.

This patch adds a new field to Process class which represents no of bits
used for addresses by the current process. A get/set function is also
added for the same.

This is useful for architectures where not all ptr bits are used for
addressing, rather some of the top bits are used to store extra
information. For example on AArch64 52 bits are maximum possible bits
available for addressing while remaining bits are used to store tags
or pointer authentication code.

This causes problem for unwinder in case return address register
contains extra information in top bits. This patch adds a function to
ABISysV_arm64 which clear those top bits and resulting sign extended
address is returned for use wherever required.

This patch also configures RegisterContextPOSIXCore_arm64 to calcualte
and set address bits currently being used by the process.

This includes elf-core test demonstrating unwinder can successfully
calculate elf-core backtrace in presence of PAC code in return address.

A follow up patch will include AArch64 Linux support for the same.


https://reviews.llvm.org/D99944

Files:
  lldb/include/lldb/Target/Process.h
  lldb/source/Plugins/ABI/AArch64/ABISysV_arm64.cpp
  lldb/source/Plugins/ABI/AArch64/ABISysV_arm64.h
  lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm64.cpp
  lldb/test/API/functionalities/postmortem/elf-core/TestLinuxCore.py
  lldb/test/API/functionalities/postmortem/elf-core/linux-aarch64-pac.out

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D99944.335481.patch
Type: text/x-patch
Size: 5729 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20210406/8adf8968/attachment.bin>


More information about the lldb-commits mailing list