Skip to content

Implement DLQ_GetPtrAuthMask using info from debugserver. #4135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions lldb/source/Plugins/LanguageRuntime/Swift/LLDBMemoryReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,17 @@ namespace lldb_private {
bool LLDBMemoryReader::queryDataLayout(DataLayoutQueryType type, void *inBuffer,
void *outBuffer) {
switch (type) {
// FIXME: add support for case DLQ_GetPtrAuthMask rdar://70729149
case DLQ_GetPtrAuthMask:
return false;
case DLQ_GetPtrAuthMask: {
assert(m_process.GetCodeAddressMask() == m_process.GetDataAddressMask() &&
"not supported");
lldb::addr_t ptrauth_mask = m_process.GetCodeAddressMask();
if (!ptrauth_mask)
return false;
// The mask returned by the process masks out the non-addressable bits.
uint64_t mask_pattern = ~ptrauth_mask;
memcpy(outBuffer, &mask_pattern, sizeof(uint64_t));
return true;
}
case DLQ_GetObjCReservedLowBits: {
auto *result = static_cast<uint8_t *>(outBuffer);
auto &triple = m_process.GetTarget().GetArchitecture().GetTriple();
Expand Down