[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
This commit is contained in:
Vedant Kumar
2021-09-14 16:58:40 -07:00
parent a65f6aafe2
commit 7eb67748f9
8 changed files with 226 additions and 6 deletions

View File

@@ -745,13 +745,14 @@ public:
PrintRegisterValue(reg_ctx, "sp", nullptr, 8, data);
PrintRegisterValue(reg_ctx, "pc", nullptr, 8, data);
PrintRegisterValue(reg_ctx, "cpsr", nullptr, 4, data);
data.PutHex32(0); // uint32_t pad at the end
// Write out the EXC registers
// data.PutHex32 (EXCRegSet);
// data.PutHex32 (EXCWordCount);
// WriteRegister (reg_ctx, "far", NULL, 8, data);
// WriteRegister (reg_ctx, "esr", NULL, 4, data);
// WriteRegister (reg_ctx, "exception", NULL, 4, data);
data.PutHex32(EXCRegSet);
data.PutHex32(EXCWordCount);
PrintRegisterValue(reg_ctx, "far", NULL, 8, data);
PrintRegisterValue(reg_ctx, "esr", NULL, 4, data);
PrintRegisterValue(reg_ctx, "exception", NULL, 4, data);
return true;
}
return false;