[MachCore] Report arm64 thread exception state
authorVedant Kumar <vsk@apple.com>
Tue, 14 Sep 2021 23:58:40 +0000 (16:58 -0700)
committerVedant Kumar <vsk@apple.com>
Fri, 17 Sep 2021 23:45:03 +0000 (16:45 -0700)
commit3b14d80ad4af303c9f7df189b8b7eee528d0ec8d
tree167f322249a973153c353cef2bb2791ebc01f1fa
parentbcb2591b6ca00365cb9f99efafeb3bfe8682f002
[MachCore] Report arm64 thread exception state

A MachO userspace corefile may contain LC_THREAD commands which specify
thread exception state.

For arm64* only (for now), report a human-readable version of this state
as the thread stop reason, instead of 'SIGSTOP'.

As a follow-up, similar functionality can be implemented for x86 cores
by translating the trapno/err exception registers.

rdar://82898146

Differential Revision: https://reviews.llvm.org/D109795
lldb/include/lldb/Target/AppleArm64ExceptionClass.def [new file with mode: 0644]
lldb/include/lldb/Target/AppleArm64ExceptionClass.h [new file with mode: 0644]
lldb/include/lldb/module.modulemap
lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
lldb/source/Plugins/Process/mach-core/ThreadMachCore.cpp
lldb/test/API/functionalities/postmortem/mach-core/TestMachCore.py
lldb/test/API/functionalities/postmortem/mach-core/operating_system.py
lldb/test/API/macosx/corefile-exception-reason/Makefile [new file with mode: 0644]
lldb/test/API/macosx/corefile-exception-reason/TestCorefileExceptionReason.py [new file with mode: 0644]
lldb/test/API/macosx/corefile-exception-reason/main.cpp [new file with mode: 0644]