Skip to content

Commit 1f7ddff

Browse files
committed
[lldb] Recognize MTE faults with EXC_GUARD exception type
Recognize the new `EXC_GUARD` mach exception type for MTE faults. We also keep supporting the old `EXC_BAD_ACCESS` exception type for backward compatibility (newer LLDB on older OS). rdar://166415268
1 parent 88175e6 commit 1f7ddff

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lldb/source/Plugins/Process/Utility/StopInfoMachException.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ static void DescribeAddressBriefly(Stream &strm, const Address &addr,
7878
}
7979

8080
std::optional<addr_t> StopInfoMachException::GetTagFaultAddress() const {
81-
bool bad_access = (m_value == 1); // EXC_BAD_ACCESS
81+
bool bad_access =
82+
(m_value == 1 || m_value == 12); // EXC_BAD_ACCESS or EXC_GUARD
8283
bool tag_fault = (m_exc_code == 0x106); // EXC_ARM_MTE_TAG_FAULT
8384
bool has_fault_addr = (m_exc_data_count >= 2); // m_exc_subcode -> fault addr
8485

@@ -497,6 +498,8 @@ const char *StopInfoMachException::GetDescription() {
497498
#endif
498499
break;
499500
case 12:
501+
if (DetermineTagMismatch())
502+
return m_description.c_str();
500503
exc_desc = "EXC_GUARD";
501504
break;
502505
}

0 commit comments

Comments
 (0)