Text of lldb.llvm.org › cpp_reference › StopInfoMachException_8h_source.html as Styx crawled it on Nov 20, 2026. The page may have changed since. Only its words are kept, without pictures or layout.

Open the live page

LLDB: StopInfoMachException.h Source File

LLDB mainline llvm-project lldb source Plugins Process Utility StopInfoMachException.h Go to the documentation of this file. 1 //===-- StopInfoMachException.h ---------------------------------*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 #ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_STOPINFOMACHEXCEPTION_H 10 #define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_STOPINFOMACHEXCEPTION_H 11 12 #include <algorithm> 13 #include <optional> 14 #include <string> 15 16 #include " lldb/Target/StopInfo.h " 17 18 #if defined(__APPLE__) 19 // Needed for the EXC_* defines 20 #include <mach/exception.h> 21 #endif 22 23 namespace lldb_private { 24 25 class StopInfoMachException : public StopInfo { 26 /// Determine the pointer-authentication related failure that caused this 27 /// exception.

Returns true and fills out the failure description if there 28 /// is auth-related failure, and returns false otherwise. 29 bool DeterminePtrauthFailure ( ExecutionContext &exe_ctx); 30 31 bool DetermineTagMismatch (); 32 33 bool DetermineCPA2Failure (); 34 35 public : 36 // Constructors and Destructors 37 StopInfoMachException ( Thread &thread, uint32_t exc_type, 38 uint32_t exc_data_count, uint64_t exc_code, 39 uint64_t exc_subcode, 40 bool not_stepping_but_got_singlestep_exception) 41 : StopInfo (thread, exc_type), m_exc_data_count (exc_data_count), 42 m_exc_code (exc_code), m_exc_subcode (exc_subcode), 43 m_not_stepping_but_got_singlestep_exception ( 44 not_stepping_but_got_singlestep_exception) {} 45 46 ~StopInfoMachException () override = default ; 47 48 lldb::StopReason GetStopReason () const override { 49 return lldb::eStopReasonException ; 50 } 51 52 const char * GetDescription () override ; 53 54 uint32_t GetStopReasonDataCount () const override { 55 // We return the Exception Type as the first element, then the code and 56 // subcode.

But we don't store any further exception data, so we can't 57 // return more than these three elements regardless of the data count. 58 // Not many exceptions we deal with have more than code & subcode, however 59 // so fixing that isn't urgent. 60 return std::min((uint32_t)3, m_exc_data_count + 1); 61 } 62 63 uint64_t GetStopReasonDataAtIndex (uint32_t idx) override { 64 // FIXME: We really should return all the exception data, but for now we 65 // just cheese out and return only the exception type.

66 if (idx >= GetStopReasonDataCount ()) 67 return 0; 68 69 switch (idx) { 70 case 0: 71 return GetValue (); 72 case 1: 73 return m_exc_code ; 74 case 2: 75 return m_exc_subcode ; 76 default : 77 return 0; 78 } 79 } 80 81 // Returns the fault address, iff this is a EXC_ARM_MTE_TAG_FAULT. 82 std::optional<lldb::addr_t> GetTagFaultAddress () const ; 83 84 #if defined(__APPLE__) 85 struct MachException { 86 static const char *Name(exception_type_t exc_type); 87 static std::optional<exception_type_t> ExceptionCode( const char *name); 88 }; 89 #endif 90 91 /// Allow this plugin to respond to stop events to enable skip-over-trap 92 /// behaviour on AArch64.

93 void PerformAction ( Event *event_ptr) override ; 94 95 // Since some mach exceptions will be reported as breakpoints, signals, 96 // or trace, we use this static accessor which will translate the mach 97 // exception into the correct StopInfo. 98 static lldb::StopInfoSP CreateStopReasonWithMachException ( 99 Thread &thread, uint32_t exc_type, uint32_t exc_data_count, 100 uint64_t exc_code, uint64_t exc_sub_code, uint64_t exc_sub_sub_code, 101 bool pc_already_adjusted = true , bool adjust_pc_if_needed = false ); 102 103 bool WasContinueInterrupted ( Thread &thread) override ; 104 105 protected : 106 uint32_t m_exc_data_count ; 107 uint64_t m_exc_code ; 108 uint64_t m_exc_subcode ; 109 110 bool m_not_stepping_but_got_singlestep_exception ; 111 }; 112 113 } // namespace lldb_private 114 115 #endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_STOPINFOMACHEXCEPTION_H StopInfo.h lldb_private::ExecutionContext "lldb/Target/ExecutionContext.h" A class that contains an execution context.

Definition ExecutionContext.h:295 lldb_private::StopInfoMachException::GetStopReasonDataCount uint32_t GetStopReasonDataCount() const override Definition StopInfoMachException.h:54 lldb_private::StopInfoMachException::PerformAction void PerformAction(Event *event_ptr) override Allow this plugin to respond to stop events to enable skip-over-trap behaviour on AArch64. Definition StopInfoMachException.cpp:854 lldb_private::StopInfoMachException::GetDescription const char * GetDescription() override Definition StopInfoMachException.cpp:276 lldb_private::StopInfoMachException::DeterminePtrauthFailure bool DeterminePtrauthFailure(ExecutionContext &exe_ctx) Determine the pointer-authentication related failure that caused this exception.

Definition StopInfoMachException.cpp:118 lldb_private::StopInfoMachException::WasContinueInterrupted bool WasContinueInterrupted(Thread &thread) override A Continue operation can result in a false stop event before any execution has happened. Definition StopInfoMachException.cpp:873 lldb_private::StopInfoMachException::m_exc_code uint64_t m_exc_code Definition StopInfoMachException.h:107 lldb_private::StopInfoMachException::GetTagFaultAddress std::optional< lldb::addr_t > GetTagFaultAddress() const Definition StopInfoMachException.cpp:80 lldb_private::StopInfoMachException::GetStopReason lldb::StopReason GetStopReason() const override Definition StopInfoMachException.h:48 lldb_private::StopInfoMachException::GetStopReasonDataAtIndex uint64_t GetStopReasonDataAtIndex(uint32_t idx) override Definition StopInfoMachException.h:63 lldb_private::StopInfoMachException::m_exc_data_count uint32_t m_exc_data_count Definition StopInfoMachException.h:106 lldb_private::StopInfoMachException::m_not_stepping_but_got_singlestep_exception bool m_not_stepping_but_got_singlestep_exception Definition StopInfoMachException.h:110 lldb_private::StopInfoMachException::CreateStopReasonWithMachException static lldb::StopInfoSP CreateStopReasonWithMachException(Thread &thread, uint32_t exc_type, uint32_t exc_data_count, uint64_t exc_code, uint64_t exc_sub_code, uint64_t exc_sub_sub_code, bool pc_already_adjusted=true, bool adjust_pc_if_needed=false) Definition StopInfoMachException.cpp:631 lldb_private::StopInfoMachException::~StopInfoMachException ~StopInfoMachException() override=default lldb_private::StopInfoMachException::m_exc_subcode uint64_t m_exc_subcode Definition StopInfoMachException.h:108 lldb_private::StopInfoMachException::DetermineTagMismatch bool DetermineTagMismatch() Definition StopInfoMachException.cpp:96 lldb_private::StopInfoMachException::DetermineCPA2Failure bool DetermineCPA2Failure() Definition StopInfoMachException.cpp:255 lldb_private::StopInfoMachException::StopInfoMachException StopInfoMachException(Thread &thread, uint32_t exc_type, uint32_t exc_data_count, uint64_t exc_code, uint64_t exc_subcode, bool not_stepping_but_got_singlestep_exception) Definition StopInfoMachException.h:37 lldb_private::StopInfo::GetValue uint64_t GetValue() const Definition StopInfo.h:46 lldb_private::StopInfo::Thread friend class Thread Definition StopInfo.h:253 lldb_private::StopInfo::StopInfo StopInfo(Thread &thread, uint64_t value) Definition StopInfo.cpp:37 lldb_private A class that represents a running process on the host machine.

Definition SBAddressRange.h:14 lldb_private::WindowsLog::Event @ Event Definition ProcessWindowsLog.h:19 lldb::StopInfoSP std::shared_ptr< lldb_private::StopInfo > StopInfoSP Definition lldb-forward.h:474 lldb::StopReason StopReason Thread stop reasons. Definition lldb-enumerations.h:308 lldb::eStopReasonException @ eStopReasonException Definition lldb-enumerations.h:315 Generated on for LLDB by 1.14.0