1 //===-- StopInfoMachException.h ---------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef liblldb_StopInfoMachException_h_
10 #define liblldb_StopInfoMachException_h_
14 #include "lldb/Target/StopInfo.h"
16 namespace lldb_private {
18 class StopInfoMachException : public StopInfo {
20 // Constructors and Destructors
21 StopInfoMachException(Thread &thread, uint32_t exc_type,
22 uint32_t exc_data_count, uint64_t exc_code,
24 : StopInfo(thread, exc_type), m_exc_data_count(exc_data_count),
25 m_exc_code(exc_code), m_exc_subcode(exc_subcode) {}
27 ~StopInfoMachException() override = default;
29 lldb::StopReason GetStopReason() const override {
30 return lldb::eStopReasonException;
33 const char *GetDescription() override;
35 // Since some mach exceptions will be reported as breakpoints, signals,
36 // or trace, we use this static accessor which will translate the mach
37 // exception into the correct StopInfo.
38 static lldb::StopInfoSP CreateStopReasonWithMachException(
39 Thread &thread, uint32_t exc_type, uint32_t exc_data_count,
40 uint64_t exc_code, uint64_t exc_sub_code, uint64_t exc_sub_sub_code,
41 bool pc_already_adjusted = true, bool adjust_pc_if_needed = false);
44 uint32_t m_exc_data_count;
46 uint64_t m_exc_subcode;
49 } // namespace lldb_private
51 #endif // liblldb_StopInfoMachException_h_