This is an archive of the discontinued LLVM Phabricator instance.

[LLDB] Support AArch64 PAC elf-core register read
ClosedPublic

Authored by omjavaid on Apr 6 2021, 3:48 AM.

Details

Summary

This adds support for reading AArch64 Pointer Authentication regset
from elf-core file. Also includes a test-case for the same. Furthermore
there is also a slight refactoring of RegisterContextPOSIXCore_arm64
members and constructor. linux-aarch64-pac.core file is generated using
lldb/test/API/functionalities/postmortem/elf-core/main.c with following
clang arguments:
-march=armv8.5-a -mbranch-protection=pac-ret+leaf -nostdlib -static -g

Diff Detail

Event Timeline

omjavaid created this revision.Apr 6 2021, 3:48 AM
omjavaid requested review of this revision.Apr 6 2021, 3:48 AM
DavidSpickett added inline comments.Apr 6 2021, 4:14 AM
lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm64.cpp
32

How is the sizeof() calculated here? Is it the size of the masks themselves, or a header block. (SVE above is clearly a header of some kind)

lldb/test/API/functionalities/postmortem/elf-core/TestLinuxCore.py
451

Do you need anything special to generate the core file? Might be worth noting in the commit message.

Though I guess you can just compile a hello world on a Linux system with PAC.

453
values = {
  "data_mask": "...",
  ...
}

(or dict(data_mask="..."))

labath added a comment.Apr 8 2021, 5:16 AM

Seems reasonable to me. I'm happy if @DavidSpickett is.

omjavaid updated this revision to Diff 340680.Apr 26 2021, 4:24 PM
omjavaid edited the summary of this revision. (Show Details)

Resolved review comments.

omjavaid marked an inline comment as done.Apr 26 2021, 4:27 PM
omjavaid added inline comments.
lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm64.cpp
32

added a comment to reflect reason behind pac data minimum size

lldb/test/API/functionalities/postmortem/elf-core/TestLinuxCore.py
451

Updated commit message.

This revision is now accepted and ready to land.Apr 27 2021, 1:28 AM
This revision was landed with ongoing or failed builds.May 3 2021, 4:06 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMay 3 2021, 4:06 AM