diff --git a/lldb/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp b/lldb/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp --- a/lldb/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp +++ b/lldb/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp @@ -2022,8 +2022,29 @@ switch (set) { case e_regSetGPR: if (reg <= gpr_pc) { - if (reg == gpr_pc || reg == gpr_lr || reg == gpr_sp || reg == gpr_fp) - value->value.uint64 = clear_pac_bits(m_state.context.gpr.__x[reg]); +#if __has_feature(ptrauth_calls) && defined(__LP64__) + if (reg == gpr_pc) + value->value.uint64 = clear_pac_bits( + reinterpret_cast(m_state.context.gpr.__opaque_pc)); + else if (reg == gpr_lr) + value->value.uint64 = clear_pac_bits( + reinterpret_cast(m_state.context.gpr.__opaque_lr)); + else if (reg == gpr_sp) + value->value.uint64 = clear_pac_bits( + reinterpret_cast(m_state.context.gpr.__opaque_sp)); + else if (reg == gpr_fp) + value->value.uint64 = clear_pac_bits( + reinterpret_cast(m_state.context.gpr.__opaque_fp)); +#else + if (reg == gpr_pc) + value->value.uint64 = clear_pac_bits(m_state.context.gpr.__pc); + else if (reg == gpr_lr) + value->value.uint64 = clear_pac_bits(m_state.context.gpr.__lr); + else if (reg == gpr_sp) + value->value.uint64 = clear_pac_bits(m_state.context.gpr.__sp); + else if (reg == gpr_fp) + value->value.uint64 = clear_pac_bits(m_state.context.gpr.__fp); +#endif else value->value.uint64 = m_state.context.gpr.__x[reg]; return true;